archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1580689 - /archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
Date Mon, 24 Mar 2014 01:36:04 GMT
Author: olamy
Date: Mon Mar 24 01:36:04 2014
New Revision: 1580689

URL: http://svn.apache.org/r1580689
Log:
add NPE check

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

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java?rev=1580689&r1=1580688&r2=1580689&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
Mon Mar 24 01:36:04 2014
@@ -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 );
 
         }



Mime
View raw message