Skip to content

Commit cd8b732

Browse files
CNDB-15558: ULID-based SSTable ID generation can fail with an NPE
1 parent 1200c45 commit cd8b732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java/org/apache/cassandra/io/sstable/ULIDBasedSSTableId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public Supplier<ULIDBasedSSTableId> generator(Stream<SSTableId> existingIdentifi
133133
{
134134
newVal = ulid.nextValue();
135135
}
136-
} while (newVal != null && !prevRef.compareAndSet(prevVal, newVal));
136+
} while (newVal == null || !prevRef.compareAndSet(prevVal, newVal));
137137
return new ULIDBasedSSTableId(newVal);
138138
};
139139
}

0 commit comments

Comments
 (0)