Summary: Need to check for != nil, not just boolean expression
Reviewed By: mcslee
Test Plan: Send a boolean "false" value
Other Notes: Patch submitted by Patrick Collison
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665310
13f79535-47bb-0310-9956-
ffa450edef68
def write(oprot)
oprot.writeStructBegin(self.class.name)
each_field do |fid, type, name|
- if (value = instance_variable_get("@#{name}"))
+ if ((value = instance_variable_get("@#{name}")) != nil)
if is_container? type
oprot.writeFieldBegin(name, type, fid)
write_container(oprot, value, fields[fid])