Fixed a null pointer exception when removing resources with missing files

Resolves #259