From ef8ff531e3cd5e852850b0f0958940b364a42c06 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 18 Jul 2020 18:21:36 +0100 Subject: [PATCH] Don't check invites if there aren't any self-explanatory. Check if the dict is empty before doing anything. --- jellyfin_accounts/invite_daemon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jellyfin_accounts/invite_daemon.py b/jellyfin_accounts/invite_daemon.py index 504c335..9b6f8bd 100644 --- a/jellyfin_accounts/invite_daemon.py +++ b/jellyfin_accounts/invite_daemon.py @@ -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"):