From 9a258be2d75531f8af049e311ff4580612ff7aa1 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 29 Dec 2017 17:44:10 +0000 Subject: [PATCH] Decode value in getbucket after checking that it is not none --- webapp/titanembeds/discordrest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/discordrest.py b/webapp/titanembeds/discordrest.py index cf31dae..6695271 100644 --- a/webapp/titanembeds/discordrest.py +++ b/webapp/titanembeds/discordrest.py @@ -25,7 +25,9 @@ class DiscordREST: self._set_bucket("global_limit_expire", 0) def _get_bucket(self, key): - value = redis_store.get(self.global_redis_prefix + key).decode("utf-8") + value = redis_store.get(self.global_redis_prefix + key) + if value: + value = value.decode("utf-8") return value def _set_bucket(self, key, value):