You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Chris Bannister (JIRA)" <ji...@apache.org> on 2016/05/02 17:42:12 UTC
[jira] [Commented] (THRIFT-3533) Can not send nil pointer as
service method argument
[ https://issues.apache.org/jira/browse/THRIFT-3533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15266835#comment-15266835 ]
Chris Bannister commented on THRIFT-3533:
-----------------------------------------
[~jensg] sorry for the delay, can you take a look at the latest patch, it does what you suggest which is simplest.
> Can not send nil pointer as service method argument
> ---------------------------------------------------
>
> Key: THRIFT-3533
> URL: https://issues.apache.org/jira/browse/THRIFT-3533
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Affects Versions: 0.9.3
> Reporter: Chris Bannister
> Assignee: Chris Bannister
> Attachments: 0001-THRIFT-3533-go-check-that-the-struct-is-nil-before-w.patch, 0001-go-compiler-handle-nil-fields-correctly.patch
>
>
> If you try to send a nil struct as an argument to a service method a panic occurs as it tries to write out all the fields in the struct, the python generated code has guarding 'if self.x != None:' for every struct field, whereas Go only outputs the 'if p.IsSet()' when the field is declared optional, which is not possible for argument lists.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)