i guess null is a valid return value, so yes check if its a resource.