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:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user