-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix panic in display only case for license - forward port #1408 to master #1415
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
Conversation
Prior refactoring passes missed a corner case. Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com> (cherry picked from commit dee3793) Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com> (cherry picked from commit 9293264) Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #1415 +/- ##
==========================================
+ Coverage 54.26% 54.35% +0.08%
==========================================
Files 289 289
Lines 19331 19334 +3
==========================================
+ Hits 10490 10509 +19
+ Misses 8165 8146 -19
- Partials 676 679 +3 |
| if license, err = getLicenses(ctx, authConfig, cli, options); err != nil { | ||
| return err | ||
| } | ||
| if options.displayOnly { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the fix is here, but isn't it safer and simpler to just check if license is nil?
if license, err = getLicenses(ctx, authConfig, cli, options); err != nil || license == nil {
return err
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silvin-lubecki discussing with @dhiltgen out of band; let's merge this one as-is, and do a follow up with improvements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it, let's merge the PR then.
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Forward port #1408 to master