Check if object exists before WeakMap lookups