fix fault on reset_state in memory storage (#619)

This commit is contained in:
Andrey Tikhonov 2021-07-06 01:10:51 +03:00 committed by GitHub
parent 64a7a781da
commit 2e207c636c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,6 +105,7 @@ class MemoryStorage(BaseStorage):
self.data[chat][user]['bucket'].update(bucket, **kwargs)
def _cleanup(self, chat, user):
chat, user = self.resolve_address(chat=chat, user=user)
if self.data[chat][user] == {'state': None, 'data': {}, 'bucket': {}}:
del self.data[chat][user]
if not self.data[chat]: