THRIFT-298. ruby: Exception propagation seems broken for Ruby clients
authorBryan Duxbury <bryanduxbury@apache.org>
Tue, 3 Feb 2009 00:31:55 +0000 (00:31 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Tue, 3 Feb 2009 00:31:55 +0000 (00:31 +0000)
This patch fixes the problem. How is anyone's guess, but we'll simplify all this code in the future.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740161 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/lib/thrift/struct.rb

index 8b6c0be..abed860 100644 (file)
@@ -173,7 +173,7 @@ module Thrift
         # this will set our field default values
         method(:struct_initialize).call()
         # now give it to the exception
-        self.class.send(:class_variable_get, :'@@__thrift_struct_real_initialize').bind(self).call(*args, &block)
+        self.class.send(:class_variable_get, :'@@__thrift_struct_real_initialize').bind(self).call(*args, &block) if args.size > 0
         # self.class.instance_method(:initialize).bind(self).call(*args, &block)
       end
     end