check for cache file before opening it

This commit is contained in:
Yannik Schmidt
2020-08-28 17:52:56 +02:00
parent e5eb8fc08f
commit e9040e4762

View File

@@ -99,6 +99,9 @@ def updateEventsFromCalDav():
def getEventsCache():
'''Return the cached events'''
if not os.path.isfile(CACHE_FILE):
return []
with open(CACHE_FILE, READ) as f:
return json.load(f)