mirror of https://github.com/apache/cloudstack.git
Fixed Coverity issue "Dereference null return value"
added a not null check and a CloudRuntimeException in case of null Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com> This closes #617
This commit is contained in:
parent
d8f37c5e17
commit
1f09b8c3bf
|
|
@ -171,7 +171,11 @@ public final class LibvirtBackupSnapshotCommandWrapper extends CommandWrapper<Ba
|
|||
final String snapshot = snapshotXML.format(args);
|
||||
s_logger.debug(snapshot);
|
||||
final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
|
||||
snap.delete(0);
|
||||
if (snap != null) {
|
||||
snap.delete(0);
|
||||
} else {
|
||||
throw new CloudRuntimeException("Unable to find vm snapshot with name -" + snapshotName);
|
||||
}
|
||||
|
||||
/*
|
||||
* libvirt on RHEL6 doesn't handle resume event emitted from
|
||||
|
|
@ -203,4 +207,4 @@ public final class LibvirtBackupSnapshotCommandWrapper extends CommandWrapper<Ba
|
|||
}
|
||||
return new BackupSnapshotAnswer(command, true, null, snapshotRelPath + File.separator + snapshotName, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue