Fixed crash when uploading empty APRS message to APRS-IS
This commit is contained in:
@@ -55,3 +55,9 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
- PE1RXF telemetry to MQTT bridge
|
||||
- Forwarding of APRS messages to MQTT
|
||||
|
||||
## [0.1.4] - 2024-03-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- Sporadic crash when uploading RF packet to APRS-IS when payload (message) is empty. Added extra check to payload.
|
||||
|
@@ -222,6 +222,14 @@ def process_aprsis(packet):
|
||||
return 1
|
||||
|
||||
def send_aprsis(srcCall, dest, digi, msg):
|
||||
# Bug, once the program crashed when accessing msg[0] because of "error IndexError: string index out of range". This should never happen, because the function parsePacket checks for this.
|
||||
# But id did happen, don't know why. But to prevent is from happening again, we check it here as well:
|
||||
try:
|
||||
tmp = msg[0]
|
||||
except:
|
||||
print("Empty APRS message, nothing to do.")
|
||||
return 1
|
||||
|
||||
try:
|
||||
APRSIS.connect()
|
||||
except:
|
||||
@@ -549,7 +557,7 @@ def run():
|
||||
|
||||
#aprs_frame = axaddress[0] + '>' + destination + ',' + ','.join(digipeaters) + ':' + payload
|
||||
#print (aprs_frame)
|
||||
if payload == 'NOT VALID':
|
||||
if payload == 'NOT VALID' or payload == 0:
|
||||
print (">>> Packet not valid, ignored.")
|
||||
else:
|
||||
log_ax25(axaddress[port], source, destination, ','.join(digipeaters), payload, 'R')
|
||||
|
Reference in New Issue
Block a user