Guard against exceptions when reading properties.

This commit is contained in:
James Roseborough
2014-03-09 18:05:25 +00:00
parent a6105d5f62
commit df6167cb66

View File

@@ -72,8 +72,12 @@ import org.luaj.vm2.Varargs;
* @see <a href="http://www.lua.org/manual/5.2/manual.html#6.10">Lua 5.2 Debug Lib Reference</a> * @see <a href="http://www.lua.org/manual/5.2/manual.html#6.10">Lua 5.2 Debug Lib Reference</a>
*/ */
public class DebugLib extends TwoArgFunction { public class DebugLib extends TwoArgFunction {
public static final boolean CALLS = (null != System.getProperty("CALLS")); public static boolean CALLS;
public static final boolean TRACE = (null != System.getProperty("TRACE")); public static boolean TRACE;
static {
try { CALLS = (null != System.getProperty("CALLS")); } catch (Exception e) {}
try { TRACE = (null != System.getProperty("TRACE")); } catch (Exception e) {}
}
private static final LuaString LUA = valueOf("Lua"); private static final LuaString LUA = valueOf("Lua");
private static final LuaString QMARK = valueOf("?"); private static final LuaString QMARK = valueOf("?");