summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-02-01 15:54:08 +0100
committerJose M. Guisado <jguisado@soleta.eu>2022-02-01 16:04:00 +0100
commit700aa89ea99c7d48350fb99c947c60fc02c0323e (patch)
tree69781ea4ac8cdda7fb7a1743ceb215a4b142ba44 /src
parentecd735c9dca3b4f77c99619b46eeb23b9f799a4c (diff)
#1065 Use getattr when retrieving event socket
If ogClient does not run on windows or linux mode, it does not create a datagram event socket. If ogClient runs in virtual or live mode this will cause an error when calling get_event_socket because the class instance has no member "event_sock". Use getattr when retrieving the event socket from ogClient class, if there is no event socket, then return None. Fixes 2465ef25b741 (Add event datagram socket)
Diffstat (limited to 'src')
-rw-r--r--src/ogClient.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ogClient.py b/src/ogClient.py
index a167c71..29b2ebf 100644
--- a/src/ogClient.py
+++ b/src/ogClient.py
@@ -48,7 +48,7 @@ class ogClient:
return self.sock
def get_event_socket(self):
- return self.event_sock
+ return getattr(self, 'event_sock', None)
def get_state(self):
return self.state