In JavaAdapter.currentFactory() do not assume that there is always active Context available and fallback to ContextFactory.getGlobal() in that case.

git-svn-id: svn://10.0.0.236/trunk@160606 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
igor%mir2.org
2004-08-10 15:52:19 +00:00
parent fd51a56646
commit f8ee0283ff

View File

@@ -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;
}
/**