diff --git a/aiogram/contrib/fsm_storage/files.py b/aiogram/contrib/fsm_storage/files.py index f67a6f69..455ca3f0 100644 --- a/aiogram/contrib/fsm_storage/files.py +++ b/aiogram/contrib/fsm_storage/files.py @@ -20,7 +20,8 @@ class _FileStorage(MemoryStorage): pass async def close(self): - self.write(self.path) + if self.data: + self.write(self.path) await super(_FileStorage, self).close() def read(self, path: pathlib.Path):