File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -604,6 +604,9 @@ def handle_input(self):
604604
605605 if val .name == "KEY_DOWN" or val == "j" :
606606 if self .selectedTab == 0 :
607+ # Empty chart list (avoid division by zero)
608+ if self .chartsize == 0 :
609+ return
607610 self .selectedItem = (self .selectedItem + 1 )% self .chartsize
608611 conduc .stop ()
609612 conduc .song .stop ()
@@ -616,6 +619,10 @@ def handle_input(self):
616619 self .selectedScore = min (self .selectedScore , len (scores [chartData [self .selectedItem ]["foldername" ]])- 1 )
617620 if val .name == "KEY_UP" or val == "k" :
618621 if self .selectedTab == 0 :
622+ # Empty chart list (avoid division by zero)
623+ if self .chartsize == 0 :
624+ return
625+
619626 self .selectedItem = (self .selectedItem - 1 )% self .chartsize
620627 conduc .stop ()
621628 conduc .song .stop ()
@@ -629,6 +636,9 @@ def handle_input(self):
629636 if val .name == "KEY_LEFT" or val == "h" :
630637 self .selectedTab = max (self .selectedTab - 1 , 0 )
631638 if val .name == "KEY_RIGHT" or val == "l" :
639+ if self .chartsize == 0 :
640+ return
641+
632642 if len (scores [chartData [self .selectedItem ]["foldername" ]]) > 0 :
633643 self .selectedTab = min (self .selectedTab + 1 , 1 )
634644 if val == "a" :
You can’t perform that action at this time.
0 commit comments