Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HandlsAds/TimeUTC doesn't handle missing fields #217

Open
andyvan-trabus opened this issue Sep 8, 2021 · 0 comments
Open

HandlsAds/TimeUTC doesn't handle missing fields #217

andyvan-trabus opened this issue Sep 8, 2021 · 0 comments

Comments

@andyvan-trabus
Copy link
Contributor

I was running the tag_block code on a file of AIS messages, and I got an exception:

File "/home/avanpelt/git/libais/ais/tag_block.py", line 135, in put
decoded = nmea_messages.DecodeLine(match['payload'])
File "/home/avanpelt/git/libais/ais/nmea_messages.py", line 470, in DecodeLine
message = HANDLERSsentence
File "/home/avanpelt/git/libais/ais/nmea_messages.py", line 127, in HandleAds
TimeUtc(fields)
File "/home/avanpelt/git/libais/ais/nmea_messages.py", line 52, in TimeUtc
seconds, fractional_seconds = FloatSplit(float(fields['seconds']))
TypeError: float() argument must be a string or a number, not 'NoneType'

line = '$ANADS,L3 AIS ID,,A,4,I,N*02'
sentence = 'ADS'
fields = {'talker': 'AN', 'sentence': 'ADS', 'id': 'L3 AIS ID', 'time_utc': None, 'hours': None, 'minutes': None, 'seconds': None, 'alarm': '', 'time_sync_method': '4', 'pos_src': 'I', 'time_src': 'N', 'checksum': '02'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant