ソースを参照

Do not push null pointer user types

Ole 10 年 前
コミット
8c6ab68287
共有1 個のファイルを変更した3 個の追加0 個の削除を含む
  1. 3 0
      lib/luwra/usertypes.hpp

+ 3 - 0
lib/luwra/usertypes.hpp

@@ -205,6 +205,9 @@ struct Value<T*> {
 
 	static inline
 	int push(State* state, T* instance) {
+		if (instance == nullptr)
+			return 0;
+
 		// push instance as light user data
 		lua_pushlightuserdata(state, instance);