Skip to content

Commit 9940daf

Browse files
authored
Merge pull request #134 from rohangirishrao/fix-parse-url
Sanitize input string in `omerotools.parse_url`
2 parents 15471d6 + 2eb8ee2 commit 9940daf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/imcflibs/imagej/omerotools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def parse_url(client, omero_str):
5757
>>> for wrapper in img_wrappers:
5858
>>> imp = wpr.toImagePlus(client)
5959
"""
60+
if not str(omero_str).strip():
61+
raise ValueError("No OMERO link or image ID provided.")
62+
63+
# Sanitize the string
64+
omero_str = omero_str.strip()
65+
6066
image_ids = []
6167
dataset_ids = []
6268
image_wpr_list = []

0 commit comments

Comments
 (0)