From 78ce5f233145b8beda522aa6c2f2235dfb8f8d62 Mon Sep 17 00:00:00 2001 From: ambdroid <61042504+ambdroid@users.noreply.github.com> Date: Sun, 3 Sep 2023 02:41:55 -0400 Subject: [PATCH] Fix IndexError when using empty string in Colour.from_str Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/colour.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/colour.py b/discord/colour.py index e640f9df4..5772b145d 100644 --- a/discord/colour.py +++ b/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:])