adding a NULL safety check to the LuaRef destructor