Fix panic in display only case for license - forward port #1408 to master#1415
Merged
thaJeztah merged 2 commits intodocker:masterfrom Nov 14, 2018
Merged
Fix panic in display only case for license - forward port #1408 to master#1415thaJeztah merged 2 commits intodocker:masterfrom
thaJeztah merged 2 commits intodocker:masterfrom
Conversation
added 2 commits
October 3, 2018 13:48
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 { |
Contributor
There was a problem hiding this comment.
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
}
Member
There was a problem hiding this comment.
@silvin-lubecki discussing with @dhiltgen out of band; let's merge this one as-is, and do a follow up with improvements
Contributor
There was a problem hiding this comment.
I'm fine with it, let's merge the PR then.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward port #1408 to master