Skip to content

Commit

Permalink
defensive code
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jul 18, 2024
1 parent ed1fba2 commit 44b1a54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/textual/renderables/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def _apply_gradient(text: Text, gradient: Gradient, width: int) -> None:
gradient: A Textual gradient.
width: Width of gradient.
"""
if not width:
return
assert width > 0
from_color = Style.from_color
get_rich_color = gradient.get_rich_color

Expand Down

0 comments on commit 44b1a54

Please sign in to comment.