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 Context.Value. #1210

Merged
merged 2 commits into from Jan 29, 2021
Merged

Fix Context.Value. #1210

merged 2 commits into from Jan 29, 2021

Conversation

jcgregorio
Copy link
Contributor

Fix Context.Value so that it looks across all fileSets when looking for the named flag.

What type of PR is this?

(REQUIRED)

  • [ x] bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

(REQUIRED)

Before this change the added test would crash on a nil
pointer dereference because the original code would
only look in the local fileSet and not across all
the fileSets.

Which issue(s) this PR fixes:

(REQUIRED)

NONE

Testing

Added a test for Value, it currently had no test in context_test.go.
Without this change the test will crash.

Release Notes

(REQUIRED)

Fix crash in Context.Value when looking for a flag that exists in a parent context.

@jcgregorio jcgregorio requested a review from a team as a code owner December 6, 2020 02:55
@jcgregorio jcgregorio requested review from saschagrunert and coilysiren and removed request for a team December 6, 2020 02:55
saschagrunert
saschagrunert previously approved these changes Dec 6, 2020
rliebz
rliebz previously approved these changes Dec 6, 2020
@jcgregorio
Copy link
Contributor Author

Rebased to force checks to run.

rliebz
rliebz previously approved these changes Dec 8, 2020
@jcgregorio
Copy link
Contributor Author

Sorry @saschagrunert, I think I cancelled your approval when I pushed a new patch.

@jcgregorio
Copy link
Contributor Author

Ping.

@coilysiren
Copy link
Member

@jcgregorio Can you pull in the default branch to fix the failing test please 🙏🏼

Before this change the added test would crash on a nil
pointer dereference because the original code would
only look in the local fileSet and not across all
the fileSets.
@jcgregorio
Copy link
Contributor Author

@lynncyrin Done!

Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

🚚

@rliebz rliebz merged commit 5378891 into urfave:master Jan 29, 2021
@jcgregorio jcgregorio deleted the fix-context-value branch January 30, 2021 16:59
bodymovin pushed a commit to bodymovin/skia-buildbot that referenced this pull request Feb 18, 2021
Now that urfave/cli#1210 has landed.

Change-Id: If8bffcb2e470e2d7285a4d2c8f1672650f0ec43f
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/363156
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
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.

None yet

4 participants