Handle empty DB
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
decentral1se 2021-06-13 12:49:11 +02:00
parent 0ff83c60f4
commit 8ed276c1b8
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -30,7 +30,9 @@ class Redis:
async def get(self, key, loads=True): async def get(self, key, loads=True):
"""Get a specific key.""" """Get a specific key."""
if loads: if loads:
return json.loads(await self._redis.get(key)) value = await self._redis.get(key)
if value:
return json.loads(value)
return await self._redis.get(key) return await self._redis.get(key)
async def close(self): async def close(self):