Fixed a FindBugs thing
Two things need fixing

One infinite loop, one impossible null check.