Shouldn't we add a test before calling `$resource->getId()`?