Skip to content

Commit 6764b4f

Browse files
committed
fix: improve bounding box validation to handle None and empty cases
1 parent 5296361 commit 6764b4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bbox_visualizer/core/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _validate_bbox(bbox: list[int]) -> None:
5252
ValueError: If bbox is empty, has wrong length, or has invalid coordinates
5353
5454
"""
55-
if not bbox:
55+
if bbox is None or (hasattr(bbox, '__len__') and len(bbox) == 0):
5656
raise ValueError("Bounding box cannot be empty")
5757
if len(bbox) != 4:
5858
raise ValueError(

0 commit comments

Comments
 (0)