Fix: NPE thrown on VMware to KVM migration tasks listing for removed VMs (#11892)

This commit is contained in:
Nicolas Vazquez 2025-10-23 02:10:17 -03:00 committed by GitHub
parent 2fcf96267d
commit 4b74a99a57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,7 +209,10 @@ public class ImportVmTasksManagerImpl implements ImportVmTasksManager {
} }
if (task.getVmId() != null) { if (task.getVmId() != null) {
UserVmVO userVm = userVmDao.findById(task.getVmId()); UserVmVO userVm = userVmDao.findById(task.getVmId());
response.setVirtualMachineId(userVm.getUuid()); if (userVm != null) {
// Migrated VM could have been removed from CloudStack after the migration
response.setVirtualMachineId(userVm.getUuid());
}
} }
response.setCreated(task.getCreated()); response.setCreated(task.getCreated());
response.setLastUpdated(task.getUpdated()); response.setLastUpdated(task.getUpdated());