From fb0cea6cc081d8e2295c8ece3fad5b3f53482d57 Mon Sep 17 00:00:00 2001 From: Joshix Date: Fri, 15 Oct 2021 20:13:25 +0200 Subject: [PATCH] fix check for custom emojis --- discover_overlay/text_overlay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discover_overlay/text_overlay.py b/discover_overlay/text_overlay.py index e884d90..3c7254f 100644 --- a/discover_overlay/text_overlay.py +++ b/discover_overlay/text_overlay.py @@ -296,9 +296,11 @@ class TextOverlayWindow(OverlayWindow): """ Draw an inline image as a custom emoticon """ - if not shape.data in self.image_list: + if shape.data >= len(self.image_list): + logging.warning(f"{shape.data} >= {len(self.image_list)}") return - if not 'url' in self.image_list[shape.data]: + if 'url' not in self.image_list[shape.data]: + logging.warning(f"'url' not in {self.image_list[shape.data]}") return key = self.image_list[shape.data]['url'] if key not in self.attachment: