Author: fgiust
Date: Mon Jan  8 07:01:21 2007
New Revision: 494085

URL: http://svn.apache.org/viewvc?view=rev&rev=494085
Log:
MNG-2746 fixing an obvious NPE when parent path is a directory and pom is not 
found. Also reported in MNGECLIPSE-184 and CONTINUUM-1000

Modified:
    
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Modified: 
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?view=diff&rev=494085&r1=494084&r2=494085
==============================================================================
--- 
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
 (original)
+++ 
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
 Mon Jan  8 07:01:21 2007
@@ -1092,20 +1092,22 @@
                         {
                             getLogger().debug( "Parent-POM: " + 
parentModel.getId() + " for project: " + project.getId() + " cannot be loaded 
from relative path: " + parentDescriptor + "; path does not exist." );
                         }
-
-                        parentDescriptor = null;
                     }
                 }
 
-                try
-                {
-                    parentDescriptor = parentDescriptor.getCanonicalFile();
-                }
-                catch ( IOException e )
+                if ( parentDescriptor != null )
                 {
-                    getLogger().debug( "Failed to canonicalize potential 
parent POM: \'" + parentDescriptor + "\'", e );
+                    try
+                    {
+                        parentDescriptor = parentDescriptor.getCanonicalFile();
+                    }
+                    catch ( IOException e )
+                    {
+                        getLogger().debug( "Failed to canonicalize potential 
parent POM: \'" + parentDescriptor + "\'",
+                                           e );
 
-                    parentDescriptor = null;
+                        parentDescriptor = null;
+                    }
                 }
 
                 if ( parentDescriptor != null && parentDescriptor.exists() )


Reply via email to