don't read wrong value in snapshot's readObject

This commit is contained in:
2025-02-23 14:16:52 +01:00
parent 98df76d0bc
commit e64f50dd3b

View File

@@ -362,10 +362,10 @@ public class SnapshotManager {
public Optional<JDataVersionedWrapper> readObject(JObjectKey name) {
try (var it = getIterator(name)) {
if (it.hasNext()) {
var read = it.next();
if (read.getKey().equals(name)) {
return Optional.of(read.getValue());
if (!it.peekNextKey().equals(name)) {
return Optional.empty();
}
return Optional.of(it.next().getValue());
}
}
return Optional.empty();