Skip to content

Commit a15a8f1

Browse files
authored
Fix settings file storage at first/clean startup (#1023)
1 parent f3b3f10 commit a15a8f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matter_server/server/storage.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ async def async_save(self) -> None:
156156
def do_save() -> None:
157157
# make backup before we write a new file
158158
self.filename_backup.unlink(True)
159-
shutil.copy(self.filename, self.filename_backup)
159+
if self.filename.is_file():
160+
shutil.copy(self.filename, self.filename_backup)
160161

161162
# use atomomic write to avoid corrupting the file
162163
# if power is cut during write, we don't write a corrupted file

0 commit comments

Comments
 (0)