From ddc74698d384ffe7946849a38b17d877e9cb906b Mon Sep 17 00:00:00 2001 From: Kai Oberbeckmann Date: Tue, 22 Oct 2019 15:24:32 +0200 Subject: [PATCH] Initialized dataBin in canutils with None to prevent crashes when reading remote frames --- can/io/canutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/can/io/canutils.py b/can/io/canutils.py index 6333503c3..5c08e9050 100644 --- a/can/io/canutils.py +++ b/can/io/canutils.py @@ -56,10 +56,13 @@ def __iter__(self): if data and data[0].lower() == "r": isRemoteFrame = True + if len(data) > 1: dlc = int(data[1:]) else: dlc = 0 + + dataBin = None else: isRemoteFrame = False