Skip to content

Commit 44b1a54

Browse files
committed
defensive code
1 parent ed1fba2 commit 44b1a54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/textual/renderables/bar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ def _apply_gradient(text: Text, gradient: Gradient, width: int) -> None:
114114
gradient: A Textual gradient.
115115
width: Width of gradient.
116116
"""
117+
if not width:
118+
return
119+
assert width > 0
117120
from_color = Style.from_color
118121
get_rich_color = gradient.get_rich_color
119122

0 commit comments

Comments
 (0)