X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Futil%2FJSObject.java;h=9f3f4bfe50ed909d6cc0bc82ada8b9383eae0d88;hb=72ab82bd51fae1f58ca022b68b473b0ff1b6f3d9;hp=81f36ea29b222dc1aa738442d5b338b9aa160f75;hpb=c9e1bd707806233eefcaa5497a7a99a95ae3da51;p=org.ibex.core.git diff --git a/src/org/xwt/util/JSObject.java b/src/org/xwt/util/JSObject.java index 81f36ea..9f3f4bf 100644 --- a/src/org/xwt/util/JSObject.java +++ b/src/org/xwt/util/JSObject.java @@ -26,7 +26,12 @@ public class JSObject implements Scriptable { /** helper; retrieves the 'source code filename' (usually the nodeName) of the currently-executing function in this thread */ public static String getCurrentFunctionSourceName() { - Function cf = Context.getCurrentContext().currentFunction; + Context cx = Context.getCurrentContext(); + if (cx == null) { + if (Log.on) Log.log(JSObject.class, "Context.getCurrentContext() is null in getCurrentFunctionSourceName()"); + return "unknown"; + } + Function cf = cx.currentFunction; if (cf == null) return null; return (cf instanceof InterpretedFunction) ? ((InterpretedFunction)cf).getSourceName() : ((InterpretedScript)cf).getSourceName();