Fix a possible NPE with IC2 (and possibly other mods).