Prevent a NPE in openinvcommand

The version with the NPE was never released, don't worry.