Skip to content

Commit

Permalink
fix null ref
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Dec 26, 2024
1 parent ede4621 commit 69c49f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions h5pyd/_hl/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class H5Image(io.RawIOBase):
def __init__(self, domain_path, h5path="h5image", chunks_per_page=1, logger=None):
""" verify dataset can be accessed and set logger if supplied """
self._cursor = 0
if domain_path.startswith("hdf5::/"):
if domain_path and domain_path.startswith("hdf5::/"):
self._domain_path = domain_path
else:
self._domain_path = "hdf5:/" + domain_path
Expand Down Expand Up @@ -354,7 +354,7 @@ def __init__(
#
# For http prefixed values, extract the endpont and use the rest as domain path
for protocol in ("http://", "https://", "hdf5://", "http+unix://"):
if domain.startswith(protocol):
if domain and domain.startswith(protocol):
if protocol.startswith("http"):
domain = domain[len(protocol):]
# extract the endpoint
Expand Down Expand Up @@ -436,7 +436,7 @@ def __init__(
# need some special logic for the first request in local mode
# to give the sockets time to initialize

if endpoint.startswith("local"):
if endpoint and endpoint.startswith("local"):
connect_backoff = [0.5, 1, 2, 4, 8, 16]
else:
connect_backoff = []
Expand Down

0 comments on commit 69c49f3

Please sign in to comment.