-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `[]' for nil:NilClass during decode ? #46
Comments
This looks like mostly likely a bug in this library -- there is an internal data structure on each Message called |
Ah actually I tracked it down but it's not what I stated above. The I think ideally this library would detect when a conflict like this occurs... I'm not sure what the best way to handle it is, though. Maybe just rename the field to add a prefix underscore, so it ends up being In the meantime, can you rename this field in your proto definition? That will work around the problem. |
OK, many thanks for identifying the problem. I can create issue for DNS server repo and suggest change of name for that field but i don't know if they will be interested in fixing or accepting a PR if i send. I think it would be quicker to update this library. If you can point me in direction of culprit code i can try for PR ? |
Thinking about it more, That said, there's quite a few places where code will have to change -- I see around 18 calls to One other workaround for now would be to rename the field in just your local |
OK thanks.. for quick win i deleted the I don't know if my Ruby knowledge is sufficient to realise the needed changes but if i get time i'll take a punt.. if you don't get PR within a week then know i failed miserably and will need your help. |
haha, totally understand |
Hi
I am using this proto https://github.com/PowerDNS/pdns/blob/master/pdns/dnsmessage.proto which i compiled to give me the following
.rb.
But when i receive
DNSResponse
events from the DNS server it get errors e.g.This only happens when i receive an event with one or more
DNSRR
entries.. when there are none it works OK.For example a message produced on the source that works is
And one that fails is
Can you suggest please if this is a problem with the compiled protobuf definition or maybe a bug ?
thank you.
The text was updated successfully, but these errors were encountered: