Do not crash when a resource is missing. (reverted from commit cb0e5ea375828e4dcc98182ba4755ca817aed9c9)