Add the same check to resources for #22539