зеркало из https://github.com/mozilla/gecko-dev.git
In JavaAdapter.currentFactory() do not assume that there is always active Context available and fallback to ContextFactory.getGlobal() in that case.
This commit is contained in:
Родитель
51adf8633f
Коммит
771b98446a
|
@ -609,7 +609,16 @@ public final class JavaAdapter implements IdFunctionCall
|
|||
|
||||
public static ContextFactory currentFactory()
|
||||
{
|
||||
return Context.getContext().getFactory();
|
||||
ContextFactory factory;
|
||||
Context cx = Context.getCurrentContext();
|
||||
if (cx == null) {
|
||||
// It can happen during instantiating of classes created
|
||||
// with the class compiler in script-unaware application.
|
||||
factory = ContextFactory.getGlobal();
|
||||
} else {
|
||||
factory = cx.getFactory();
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче