diff --git a/badwitch.py b/badwitch.py index cccdb06..9e42f35 100755 --- a/badwitch.py +++ b/badwitch.py @@ -25,9 +25,13 @@ class Library: # Load from file def load(self): - with open(self.file, 'r+') as libfd: - libfd.seek(0) - self.albums = json.load(libfd) + try: + with open(self.file, 'r+') as libfd: + libfd.seek(0) + self.albums = json.load(libfd) + except FileNotFoundError: + logging.debug('Could not find library, loading empty') + self.albums = {} return # Save to file