Nice catch! It seems like this bug was never occurring because the loop condition has never been satisfied?