check is_resource Closes #2201.