https://studio.code.org/projects/applab/4TQKW28AhMF8To7ZW64CrAboDO2CLB_dJnO8KtfgAQI
When debugging code it is often the case that the problem is not where the error occurs. It would be nice if that was always true, which is what unit testing is all about, but that is another discussion.
The error happens at line 19. Try to translate the code into English. What is that conditional asking? Check the database is this a reasonable thing to ask about the data?
I have noticed this exact specific error occurring multiple times with different students in multiple cities. Is there a source? Are we teaching them this? Are they copying it from YouTube?