mirror of https://github.com/apache/maven.git
Fixing NPE in appendPath(..) when calculating '..' path adjustments.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@382849 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aaaf6537f6
commit
138d77d3b0
|
@ -538,10 +538,16 @@ public class DefaultModelInheritanceAssembler
|
|||
lastToken = currentToken;
|
||||
currentToken = tokens.nextToken();
|
||||
|
||||
if ( "..".equals( currentToken ) )
|
||||
if ( "..".equals( currentToken ) && lastToken != null )
|
||||
{
|
||||
// trim the previous path part off...
|
||||
cleanedPath.setLength( cleanedPath.length() - ( lastToken.length() + 1 ) );
|
||||
int cleanedPathLen = cleanedPath.length();
|
||||
int lastTokenLen = lastToken.length();
|
||||
|
||||
if ( cleanedPathLen > lastTokenLen )
|
||||
{
|
||||
// trim the previous path part off...
|
||||
cleanedPath.setLength( cleanedPath.length() - ( lastToken.length() + 1 ) );
|
||||
}
|
||||
}
|
||||
else if ( !".".equals( currentToken ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue