Skip to content

Commit 7a88c30

Browse files
authored
Merge pull request #6 from margaret/issue_5
Add check that data[0] is not None before trying to parse it
2 parents 25c1c83 + 872d639 commit 7a88c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_gps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _parse_gprmc(self, args):
195195
# Parse the arguments (everything after data type) for NMEA GPRMC
196196
# minimum location fix sentence.
197197
data = args.split(',')
198-
if data is None or len(data) < 11:
198+
if data is None or len(data) < 11 or data[0] is None:
199199
return # Unexpected number of params.
200200
# Parse fix time.
201201
time_utc = int(_parse_float(data[0]))

0 commit comments

Comments
 (0)