Skip to content

Commit

Permalink
Fix setting archiver destination file to a one in the working dir cau…
Browse files Browse the repository at this point in the history
…ses NPE

Fixes #94
  • Loading branch information
plamentotev committed Feb 7, 2019
1 parent 98c3d0e commit 7865992
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -669,7 +669,7 @@ public void setDestFile( final File destFile )
{
this.destFile = destFile;

if ( destFile != null )
if ( destFile != null && destFile.getParentFile() != null )
{
destFile.getParentFile().mkdirs();
}
Expand Down
@@ -1,5 +1,6 @@
package org.codehaus.plexus.archiver;

import java.io.File;
import java.io.IOException;
import junit.framework.TestCase;

Expand Down Expand Up @@ -89,4 +90,8 @@ public void testOverridesCanBeReset()
assertEquals( -1, archiver.getOverrideDirectoryMode() );
}

public void testSetDestFileInTheWorkingDir() {
archiver.setDestFile( new File( "archive" ) );
}

}

0 comments on commit 7865992

Please sign in to comment.