Skip to content
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

Avoid nil reference when struct has gen.PtrOf field #43

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

rerorero
Copy link
Contributor

@rerorero rerorero commented Oct 18, 2018

Hi, this library looks so cool. Thanks for your efforts. I want to start using in my project but I found a bug while trial.

Panic sometimes occurs when struct generator has a field of PtrOf generator. It sometime generates nil value but struct generator tries to retrieve value via reflect.ValueOf().
When nil field is generated it should be set Zero value.

@au-phiware
Copy link
Contributor

I have encountered this issue also and this patch works for me, thanks.

@untoldwind untoldwind merged commit 55d63c2 into leanovate:master Oct 20, 2018
@untoldwind
Copy link
Collaborator

Ah the bane of go reflection ... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants