From 7b4b8a045d098b1c3ca0b8821912a4111b700451 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 17 Feb 2014 04:13:27 -0800 Subject: [PATCH] Strip any leading null characters from data before trying to parse message --- alarmdecoder/decoder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index 568de9d..19349ca 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -294,6 +294,8 @@ class AlarmDecoder(object): :returns: :py:class:`~alarmdecoder.messages.Message` """ + data = data.lstrip('\0') + if data is None: raise InvalidMessageError()