mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix IndexError when using empty string in Colour.from_str
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
parent
7bdfd454be
commit
78ce5f2331
@ -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…
x
Reference in New Issue
Block a user