Fix default data when no .gui.json file exists

This commit is contained in:
miruka 2020-11-15 19:05:04 -04:00
parent 9a813ecaa8
commit c1dc9a80b2

View File

@ -266,7 +266,11 @@ class PCNFile(MappingFile):
def deserialized(self, data: str) -> Tuple[Section, bool]:
root = Section.from_source_code(data, self.path)
edits = self.write_path.read_text() if self.write_path.exists() else ""
edits = "{}"
if self.write_path.exists():
edits = self.write_path.read_text()
return (root, root.deep_merge_edits(json.loads(edits)))
def serialized(self) -> str: