From f2c2d50e4432db0383d224accdfa1c603ce0e5d8 Mon Sep 17 00:00:00 2001 From: brimoor Date: Sat, 28 Dec 2024 18:05:01 -0600 Subject: [PATCH] handle empty polylines --- eta/core/image.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eta/core/image.py b/eta/core/image.py index f4d923b5..b6d8dbdc 100644 --- a/eta/core/image.py +++ b/eta/core/image.py @@ -1122,7 +1122,11 @@ def render_bounding_box(polyline): Returns: a BoundingBox """ - xx, yy = zip(*list(itertools.chain(*polyline.points))) + try: + xx, yy = zip(*list(itertools.chain(*polyline.points))) + except ValueError: + return etag.BoundingBox.empty() + xtl = min(xx) ytl = min(yy) xbr = max(xx)