Browse Source

Fix IndexError when using empty string in Colour.from_str

Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
pull/10109/head
ambdroid 2 years ago
committed by dolfies
parent
commit
cef229db3e
  1. 3
      discord/colour.py

3
discord/colour.py

@ -196,6 +196,9 @@ class Colour:
The string could not be converted into a colour.
"""
if not value:
raise ValueError('unknown colour format given')
if value[0] == '#':
return parse_hex_number(value[1:])

Loading…
Cancel
Save