From 3e098b1757724eb2e78a4abc1306a32abaf610b2 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Tue, 30 Oct 2007 16:55:47 +0000 Subject: [PATCH] Fix handling of ruby write parameters due to nil vs false 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 --- lib/rb/lib/thrift/thrift.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rb/lib/thrift/thrift.rb b/lib/rb/lib/thrift/thrift.rb index d8e77a15..4a25959d 100644 --- a/lib/rb/lib/thrift/thrift.rb +++ b/lib/rb/lib/thrift/thrift.rb @@ -206,7 +206,7 @@ module ThriftStruct 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]) -- 2.17.1