Skip to content

Commit ce9b9bd

Browse files
feat: add typecheck for uid in _validate_uid method
1 parent 55f2e68 commit ce9b9bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dicomweb_client/uri.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ def _validate_resource_identifiers_and_suffix(
629629

630630
def _validate_uid(uid: str, permissive: bool) -> None:
631631
"""Validates a DICOM UID."""
632+
if not isinstance(uid, str):
633+
raise TypeError('DICOM UID must be a string.')
632634
if not permissive:
633635
if len(uid) > _MAX_UID_LENGTH:
634636
raise ValueError('UID cannot have more than 64 chars. '

0 commit comments

Comments
 (0)