Protection against a rare NPE

http://openeye.openmods.info/crashes/a7282839c7d95f404e4ab430c894b166