avoid NPE when there is no project file

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163991 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-21 00:49:19 +00:00
parent 666c60dea6
commit 8e279f87e1
2 changed files with 9 additions and 2 deletions

View File

@ -112,7 +112,7 @@ public class PluginParameterExpressionEvaluator
}
else if ( expression.equals( "#basedir" ) )
{
value = context.getProject().getFile().getParentFile().getAbsolutePath();
value = context.getProject().getBasedir().getAbsolutePath();
}
else if ( expression.startsWith( "#basedir" ) )
{

View File

@ -132,7 +132,14 @@ public class MavenProject
public File getBasedir()
{
return getFile().getParentFile();
if ( getFile() != null )
{
return getFile().getParentFile();
}
else
{
return new File( System.getProperty( "user.dir" ) );
}
}
public void setDependencies( List denpendencies )