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

Issue #1203 NPE if docker:save called with filename only. #1204

Merged
merged 1 commit into from
Apr 12, 2019

Conversation

wrosenuance
Copy link
Contributor

Fixes NPE that happens if you run mvn docker:save -Dfile=no-directory-name.tar

Signed-off-by: William Rose william.rose@nuance.com

@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #1204 into master will not change coverage.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #1204   +/-   ##
=========================================
  Coverage     53.08%   53.08%           
  Complexity     1532     1532           
=========================================
  Files           150      150           
  Lines          7985     7985           
  Branches       1202     1202           
=========================================
  Hits           4239     4239           
  Misses         3328     3328           
  Partials        418      418
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/io/fabric8/maven/docker/SaveMojo.java 25% <0%> (ø) 12 <0> (ø) ⬇️

2 similar comments
@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #1204 into master will not change coverage.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #1204   +/-   ##
=========================================
  Coverage     53.08%   53.08%           
  Complexity     1532     1532           
=========================================
  Files           150      150           
  Lines          7985     7985           
  Branches       1202     1202           
=========================================
  Hits           4239     4239           
  Misses         3328     3328           
  Partials        418      418
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/io/fabric8/maven/docker/SaveMojo.java 25% <0%> (ø) 12 <0> (ø) ⬇️

@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #1204 into master will not change coverage.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #1204   +/-   ##
=========================================
  Coverage     53.08%   53.08%           
  Complexity     1532     1532           
=========================================
  Files           150      150           
  Lines          7985     7985           
  Branches       1202     1202           
=========================================
  Hits           4239     4239           
  Misses         3328     3328           
  Partials        418      418
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/io/fabric8/maven/docker/SaveMojo.java 25% <0%> (ø) 12 <0> (ø) ⬇️

Signed-off-by: William Rose <william.rose@nuance.com>
@@ -106,7 +106,7 @@ private String completeCalculatedFileName(String file) throws MojoExecutionExcep
}

private void ensureSaveDir(String fileName) throws MojoExecutionException {
File saveDir = new File(fileName).getParentFile();
File saveDir = new File(fileName).getAbsoluteFile().getParentFile();
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks ! @rohanKanojia : FYI, this fix very likely fixes also #1200 if applied to getContextDir()

Copy link
Member

Choose a reason for hiding this comment

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

okay, thanks

Copy link
Collaborator

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks ! Lgtm.

@rhuss rhuss merged commit 4097464 into fabric8io:master Apr 12, 2019
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