Skip to content

Commit a7ec8e4

Browse files
authored
Merge pull request #2029 from sswguo/hotfix
Fix: Null values are not supported
2 parents a2fc546 + 1fe60fb commit a7ec8e4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

db/cassandra/src/main/java/org/commonjava/indy/cassandra/data/CassandraStoreDataManager.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,16 @@ private ArtifactStore computeIfAbsent( String name, StoreKey key, int expiration
601601
DtxArtifactStore dtxArtifactStore = storeQuery.getArtifactStore( key.getPackageType(), key.getType(), key.getName() );
602602

603603
store = toArtifactStore( dtxArtifactStore );
604-
if ( expirationMins > 0 )
605-
{
606-
cache.put( key, store, expirationMins, TimeUnit.MINUTES );
607-
}
608-
else
604+
if ( store != null )
609605
{
610-
cache.put( key, store );
606+
if (expirationMins > 0)
607+
{
608+
cache.put(key, store, expirationMins, TimeUnit.MINUTES);
609+
}
610+
else
611+
{
612+
cache.put(key, store);
613+
}
611614
}
612615
}
613616

0 commit comments

Comments
 (0)