From b226a83ccbf06b52a61dcffaddc9a9c38096ff87 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 12 Aug 2013 18:38:30 +0200 Subject: Fixing crash; entry.name can be NULL and means 'new'. --- src/BLua.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BLua.cc b/src/BLua.cc index 886f92e..7e3a1d2 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -1140,10 +1140,13 @@ void Balau::LuaHelpersBase::validate(const lua_functypes_t & entry, bool method, } if (invalid) { + const char * name = entry.name; + if (!name) + name = "new"; if (method) { - L.error(String("Invalid arguments to method `") + className + "::" + entry.name + "'"); + L.error(String("Invalid arguments to method `") + className + "::" + name + "'"); } else { - L.error(String("Invalid arguments to function `") + className + " " + entry.name + "'"); + L.error(String("Invalid arguments to function `") + className + " " + name + "'"); } } } -- cgit v1.2.3