]> source.dussan.org Git - archiva.git/commitdiff
add NPE check
authorOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 01:36:04 +0000 (01:36 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 01:36:04 +0000 (01:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580689 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java

index bf1ba51cdeb918f67d45b48242716eb87972f309..6eda35d5ef677f204ae098c0e4c7fb168c775cb1 100644 (file)
@@ -844,11 +844,19 @@ public class CassandraMetadataRepository
             updater.setString( "repositoryName", repositoryId );
             updater.setString( "namespaceId", namespaceId );
             updater.setString( "id", versionMetadata.getVersion() );
-            updater.setString( "description", versionMetadata.getDescription() );
-            updater.setString( "name", versionMetadata.getName() );
+            if ( StringUtils.isNotEmpty( versionMetadata.getDescription() ) )
+            {
+                updater.setString( "description", versionMetadata.getDescription() );
+            }
+            if ( StringUtils.isNotEmpty( versionMetadata.getName() ) )
+            {
+                updater.setString( "name", versionMetadata.getName() );
+            }
             updater.setString( "incomplete", Boolean.toString( versionMetadata.isIncomplete() ) );
-            updater.setString( "url", versionMetadata.getUrl() );
-
+            if ( StringUtils.isNotEmpty( versionMetadata.getUrl() ) )
+            {
+                updater.setString( "url", versionMetadata.getUrl() );
+            }
             projectVersionMetadataModelTemplate.update( updater );
 
         }