Hello. I have some code written for my app, and it looks perfect, but my companion app keeps crashing due to my while test do loop. Anyway to fix this?

Hello. I have some code written for my app, and it looks perfect, but my companion app keeps crashing due to my while test do loop. Anyway to fix this?