handles the case where GlobalScope::current calls CurrentGlobalOrNull
and the result is null