Avoid KeyError if saved key is missing
@@ -48,7 +48,10 @@ def save(self):
with open(env_file, "w") as txt:
txt.write("# This is .env file for PlexTraktSync\n")
for key in self.env_keys:
+ if key in self:
txt.write("{}={}\n".format(key, self[key]))
+ else:
+ txt.write("{}=\n".format(key))
CONFIG = Config()
