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

Fix for panic in fillGroupedVars #3781

Merged
merged 3 commits into from
Aug 9, 2019
Merged

Fix for panic in fillGroupedVars #3781

merged 3 commits into from
Aug 9, 2019

Conversation

pawanrawal
Copy link
Contributor

@pawanrawal pawanrawal commented Aug 9, 2019

Fixes #3768

For a uid child, DestUIDs can be nil if there were no source UIDs. This check was already happening in formResult but has been missed in this function. I am working on adding more code comments and trying to reduce the code duplication for the groupby code if possible in another PR.


This change is Reviewable

@pawanrawal pawanrawal requested review from manishrjain and a team as code owners August 9, 2019 01:54
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ A review job has been created and sent to the PullRequest network.


@pawanrawal you can click here to see the review status or cancel the code review job.

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Got a comment.

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pawanrawal)


query/groupby.go, line 298 at r1 (raw file):

			attr = child.Attr
		}
		if child.DestUIDs != nil && len(child.DestUIDs.Uids) != 0 {

Use child.DestUIDs.GetUids() which already takes care of DestUIDs being nil.

@pawanrawal pawanrawal merged commit 99652e6 into master Aug 9, 2019
pawanrawal added a commit that referenced this pull request Aug 9, 2019
Use DestUIDs() function while accessing uids from child in GroupBy query. This fixes #3768.
pawanrawal added a commit that referenced this pull request Aug 9, 2019
Use DestUIDs() function while accessing uids from child in GroupBy query. This fixes #3768.
@pawanrawal pawanrawal deleted the pawan/fix-3768 branch August 27, 2019 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

fillGroupedVars: runtime error: invalid memory address or nil pointer dereference
2 participants