From 5bf938797c73e8526b9ba228a3338d3972c2dfcd Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 25 May 2014 01:46:01 -0700 Subject: Creating a Balau project file. --- src/LuaBigInt.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/LuaBigInt.cc') diff --git a/src/LuaBigInt.cc b/src/LuaBigInt.cc index d70cc55..b608afd 100644 --- a/src/LuaBigInt.cc +++ b/src/LuaBigInt.cc @@ -134,7 +134,7 @@ int sLua_BigInt::BigInt_proceed_static(Lua & L, int n, int caller) { switch (caller) { case BIGINT_CONSTRUCTOR: { - BigInt * a; + BigInt * a = NULL; if (L.type() == LUA_TSTRING) { a = new BigInt(); s = L.tostring(1); @@ -155,9 +155,11 @@ int sLua_BigInt::BigInt_proceed_static(Lua & L, int n, int caller) { } else { L.error("Invalid arguments to BigInt:new"); } - LuaBigIntFactory o(a); - o.pushDestruct(L); - r = 1; + if (a) { + LuaBigIntFactory o(a); + o.pushDestruct(L); + r = 1; + } break; } } -- cgit v1.2.3