aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmagnus6
1 files changed, 5 insertions, 1 deletions
diff --git a/magnus b/magnus
index f05d02d..47dbba9 100755
--- a/magnus
+++ b/magnus
@@ -224,7 +224,11 @@ class Main(object):
print("couldn't restore settings (error: %s), so assuming they're blank" % (e,))
contents = "{}" # fake contents
- data = json.loads(contents)
+ try:
+ data = json.loads(contents)
+ except Exception as e:
+ print("Warning: settings file seemed to be invalid json (error: %s), so assuming blank" % (e,))
+ data = {}
zl = data.get("zoom")
if zl:
idx = 0
bgstack15