Skip to content

Commit 7359004

Browse files
Do not fail when network.notifier has not been set
Related to #165
1 parent e8e0d5d commit 7359004

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

canopen/network.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,11 @@ def check(self):
244244
If an exception caused the thread to terminate, that exception will be
245245
raised.
246246
"""
247-
exc = self.notifier.exception
248-
if exc is not None:
249-
logger.error("An error has caused receiving of messages to stop")
250-
raise exc
247+
if self.notifier is not None:
248+
exc = self.notifier.exception
249+
if exc is not None:
250+
logger.error("An error has caused receiving of messages to stop")
251+
raise exc
251252

252253
def __getitem__(self, node_id):
253254
return self.nodes[node_id]

0 commit comments

Comments
 (0)