Closed Gabrieliam42 closed 2 months ago
gui.py
Original Code Block:
elif event == "Error": msg = values["Error"].split("|:|") e = msg[0] title = msg[1] sg.popup_scrolled(e, title=title)
Updated Code Block: Replaced the above block with the following:
elif event == "Error": msg = values["Error"].split("|:|") e = msg[0] title = msg[1] if len(msg) > 1 else "Error" # Default title if msg[1] doesn't exist sg.popup_scrolled(e, title=title)
base.py
Original Code Block:
instructors = [ i["absolute_url"].split("/")[-2] for i in dma["serverSideProps"]["course"]["instructors"]["instructors_info"] ]
Updated Code Block: Replaced the above block with the following:
instructors = [ i["absolute_url"].split("/")[-2] for i in dma["serverSideProps"]["course"]["instructors"]["instructors_info"] if len(i["absolute_url"].split("/")) > 1 # Ensure there are enough elements ]
Fixed IndexError in Error handling by checking list length in base.py and gui.py