Only invoke Python user callback if set by user

This commit is contained in:
Joseph Henry
2021-05-26 18:17:37 -07:00
parent 86ffc3645e
commit 9ee053ac36

View File

@@ -26,7 +26,8 @@ class MyEventCallbackClass(_EventCallbackClass):
id = msg.peer.peer_id
# Now that we've adjusted internal state, notify user
global _user_specified_event_handler
_user_specified_event_handler(msg.event_code, id)
if _user_specified_event_handler is not None:
_user_specified_event_handler(msg.event_code, id)
class ZeroTierNode: