Fixed NullPointer Issue

Theres a new thing where indexOf returns a -1.

But this was probably going to happen if the code got to it