You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- lua codeslocalp=MyProto()
p.boolField=falseprint(p:HasField("boolField")) -- the result is: falseprint(p:Serialize()) -- the result is: false, Missing require field
The false value of boolean type was not supported.
The following is source code of lua-pb/message.lua
functionmethods:HasField(name)
localdata=rawget(self, '.data') -- field data.returnnotnotdata[name]
end
I think the code return not not data[name] may be replaced with return data[name] ~= nil. The same problem for Serialize and some other methods.
The text was updated successfully, but these errors were encountered:
I'm sorry, i'm not good at English.
For example:
The
false
value of boolean type was not supported.The following is source code of
lua-pb/message.lua
I think the code
return not not data[name]
may be replaced withreturn data[name] ~= nil
. The same problem forSerialize
and some other methods.The text was updated successfully, but these errors were encountered: