(Merged from 385635.) [MNG-2146] Added code to guard against NPE when maven.home and org.apache.maven.global-plugin-registry are both missing from the sysprops.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@385637 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2006-03-13 19:51:44 +00:00
parent 0b856d893b
commit a6983a59ab
1 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,8 @@ public class DefaultPluginRegistryBuilder
getLogger().debug( "Building Maven user-level plugin registry from: '" + userRegistryFile.getAbsolutePath() + "'" );
if ( System.getProperty( "maven.home" ) != null )
if ( System.getProperty( "maven.home" ) != null ||
System.getProperty( MavenPluginRegistryBuilder.ALT_GLOBAL_PLUGIN_REG_LOCATION ) != null )
{
globalRegistryFile = getFile( globalRegistryPath, "maven.home", MavenPluginRegistryBuilder.ALT_GLOBAL_PLUGIN_REG_LOCATION );
@ -94,7 +95,7 @@ public class DefaultPluginRegistryBuilder
{
PluginRegistry registry = null;
if ( registryFile.exists() && registryFile.isFile() )
if ( registryFile != null && registryFile.exists() && registryFile.isFile() )
{
FileReader reader = null;
try