diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-08-12 18:38:30 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2013-08-12 18:38:30 +0200 |
commit | b226a83ccbf06b52a61dcffaddc9a9c38096ff87 (patch) | |
tree | 84645c2ef7cc5e1706f53bace9512edc3289befe | |
parent | 758469279bda5810ed7cef45b5f301234bfc7596 (diff) |
Fixing crash; entry.name can be NULL and means 'new'.
-rw-r--r-- | src/BLua.cc | 7 |
1 files 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 + "'"); } } } |