fix a rare NullReferenceException in CanUnload

closes #5528
Merge pull request #5529 from Mailaender/rare-pillbox-nre

Fixed a rare NullReferenceException in CanUnload