From 8d50f4fa0f939d0a054fcd1902ea881593c9dcc6 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 23 Apr 2017 17:59:13 -0700 Subject: [PATCH] Attempt to fix redis limiter nonetype return --- titanembeds/database/custom_redislite.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/titanembeds/database/custom_redislite.py b/titanembeds/database/custom_redislite.py index ba52703..4cade78 100644 --- a/titanembeds/database/custom_redislite.py +++ b/titanembeds/database/custom_redislite.py @@ -26,7 +26,10 @@ class LimitsRedisLite(Storage): # For Python Limits return int(self.get(key)) def get(self, key): - return int(self.redis_instance.get(key)) + value = self.redis_instance.get(key) + if value: + return int(value) + return 0 def reset(self): return self.redis_instance.flushdb()