avoid potential NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@219831 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-20 02:08:53 +00:00
parent e40e709513
commit f48d2c367c
1 changed files with 8 additions and 8 deletions

View File

@ -79,22 +79,22 @@ public class SnapshotTransformation
} }
else if ( isSnapshot( artifact ) ) else if ( isSnapshot( artifact ) )
{ {
SnapshotArtifactMetadata metadata = null;
try try
{ {
SnapshotArtifactMetadata metadata;
metadata = (SnapshotArtifactMetadata) retrieveFromRemoteRepository( artifact, remoteRepository, null ); metadata = (SnapshotArtifactMetadata) retrieveFromRemoteRepository( artifact, remoteRepository, null );
metadata.update();
artifact.setVersion( metadata.constructVersion() );
artifact.addMetadata( metadata );
} }
catch ( ResourceDoesNotExistException e ) catch ( ResourceDoesNotExistException e )
{ {
// ignore. We'll be creating this metadata if it doesn't exist... // ignore. We'll be creating this metadata if it doesn't exist...
} }
metadata.update();
artifact.setVersion( metadata.constructVersion() );
artifact.addMetadata( metadata );
} }
} }