Don't check invites if there aren't any

self-explanatory. Check if the dict is empty before doing anything.
This commit is contained in:
Harvey Tindall 2020-07-18 18:21:36 +01:00
parent b863706d26
commit ef8ff531e3
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class Repeat:
def checkInvites():
invites = dict(data_store.invites)
# checkInvite already loops over everything, no point running it multiple times.
checkInvite(list(invites.keys())[0])
if len(invites) != 0:
checkInvite(list(invites.keys())[0])
if config.getboolean("notifications", "enabled"):