diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-24 01:36:04 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-24 01:36:04 +0000 |
commit | c6afb274c0d0680c35e041531b130def0e2da998 (patch) | |
tree | d5d2cd364acdc0d240e2d258a8a8c9a46e1f3dd0 /archiva-modules | |
parent | ba1c2854a0d44df1cc45084b25b4630ce9641d63 (diff) | |
download | archiva-c6afb274c0d0680c35e041531b130def0e2da998.tar.gz archiva-c6afb274c0d0680c35e041531b130def0e2da998.zip |
add NPE check
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580689 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index bf1ba51cd..6eda35d5e 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -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 ); } |