fix issue if there is only one top level card

This commit is contained in:
joBr99
2022-12-29 00:24:32 +01:00
committed by GitHub
parent b08f6897d5
commit 64d3bc9fd7

View File

@@ -166,8 +166,10 @@ class LuiBackendConfig(object):
last_card = next
cur.uuid_next = next.uuid
next.uuid_prev = cur.uuid
first_card.uuid_prev = last_card.uuid
last_card.uuid_next = first_card.uuid
# if there is only one top level card first and last card will be none
if first_card and last_card:
first_card.uuid_prev = last_card.uuid
last_card.uuid_next = first_card.uuid
# parse screensaver
self._config_screensaver = Card(self.get("screensaver"))
@@ -237,4 +239,4 @@ class LuiBackendConfig(object):
return self._config_cards[0]
def get_card_by_uuid(self, uuid):
return self._config_card_table.get(uuid)
return self._config_card_table.get(uuid)