Make sure we have a resource before we attempt to close it.