MADS: Check for sane object IDs when checking for inventory objects

This avoids crashes in cases where the default excuse is shown, for
objects that can't be operated