We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3b3f10 commit a15a8f1Copy full SHA for a15a8f1
matter_server/server/storage.py
@@ -156,7 +156,8 @@ async def async_save(self) -> None:
156
def do_save() -> None:
157
# make backup before we write a new file
158
self.filename_backup.unlink(True)
159
- shutil.copy(self.filename, self.filename_backup)
+ if self.filename.is_file():
160
+ shutil.copy(self.filename, self.filename_backup)
161
162
# use atomomic write to avoid corrupting the file
163
# if power is cut during write, we don't write a corrupted file
0 commit comments