From 87b60df05852af13980e0bfcd6639d4b734c6708 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 21 Oct 2012 08:14:27 +0000 Subject: Fixed manual bindings' ForEachXXX mapping not checking the object instance for validity. ( http://forum.mc-server.org/showthread.php?tid=591&pid=5007#pid5007 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@996 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ManualBindings.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp index 39677b7a8..46ebfd4ae 100644 --- a/source/ManualBindings.cpp +++ b/source/ManualBindings.cpp @@ -392,6 +392,11 @@ static int FNNAME(lua_State * tolua_S) \ } \ \ CONTAINER * self = (CONTAINER *) tolua_tousertype(tolua_S, 1, 0); \ + if (self == NULL) \ + { \ + LOGWARN("Error in function call '" #FOREACH "': Not called on an object instance"); \ + return 0; \ + } \ \ if (!lua_isfunction( tolua_S, 2)) \ { \ -- cgit v1.2.3