Skip to content

Commit e9c1418

Browse files
author
gitlab
committed
Merge branch 'zsv-ldap' into 'feature-zsv-5.0.0-vm-support-vtpm-and-secuceboot'
<fix>[kvm]: fix NPE in VmHostFileTracker sync See merge request zstackio/zstack!9583
2 parents 89b7039 + 3eee799 commit e9c1418

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugin/kvm/src/main/java/org/zstack/kvm/vmfiles/VmHostFileTracker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ private void syncVmHostFiles() {
269269
// check if force sync is needed based on lastSyncDate
270270
Timestamp oldestLastSync = group.stream()
271271
.map(VmHostFileVO::getLastSyncDate)
272-
.min(Comparator.nullsFirst(Comparator.naturalOrder()))
272+
.filter(Objects::nonNull)
273+
.min(Comparator.naturalOrder())
273274
.orElse(null);
274275

275276
if (oldestLastSync != null && (now - oldestLastSync.getTime()) < forceSyncThresholdMs) {

0 commit comments

Comments
 (0)