LuaBridge
LuaBridge copied to clipboard
Fix userdata nil bug
This fix prevents a segmentation fault in case a C++ function is called from Lua and nil instead of an object of a registered class is passed as parameter.
- The get function correctly tests if nil is on the stack and returns a null pointer.
- The bug is located in the StackHelper where the returned pointer is always dereferenced. This is the source of the undefined behavior/segmentation fault.