Fix error if there are no long breaks

This commit is contained in:
Gobinath 2021-02-17 09:57:41 -05:00
parent d62d44553c
commit bd4be002e1
1 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,8 @@ class BreakQueue:
break_obj = shorts[self.__current_short]
self.context['break_type'] = 'short'
# Reduce the break time from the next long break (default)
longs[self.__current_long].time -= shorts[self.__current_short].time
if longs:
longs[self.__current_long].time -= shorts[self.__current_short].time
# Update the index to next
self.__current_short = (self.__current_short + 1) % len(shorts)
@ -189,7 +190,6 @@ class BreakQueue:
def __next_long(self):
longs = self.__long_queue
shorts = self.__short_queue
break_obj = longs[self.__current_long]
self.context['break_type'] = 'long'