Fix some nullptr exceptions when handling invalid node inventories