Skip to content

Commit

Permalink
handle None case for gateway._port attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-mueller committed Jan 10, 2025
1 parent c5ce354 commit b9de082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/napari_omero/widgets/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _check_connection(self, timeout: int = 2):
# Attempt to create a socket connection to the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.settimeout(timeout)
s.connect((self._host, int(self._port)))
s.connect((self._host, int(self._port or 4064)))
return True
except (OSError, socket.timeout):
return False
Expand Down

0 comments on commit b9de082

Please sign in to comment.