mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-07 17:39:03 +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:
1 parent
7bdfd454be
commit
78ce5f2331
1 file changed
+3
@@ -196,6 +196,9 @@ class Colour:
|
|||||||
The string could not be converted into a colour.
|
The string could not be converted into a colour.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not value:
|
||||||
|
raise ValueError('unknown colour format given')
|
||||||
|
|
||||||
if value[0] == '#':
|
if value[0] == '#':
|
||||||
return parse_hex_number(value[1:])
|
return parse_hex_number(value[1:])
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user