mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 11283: deal with empty snapshot disk chain
This commit is contained in:
parent
6e6b6ab2ab
commit
9736c1e3b1
@ -175,8 +175,9 @@ public class SnapshotDescriptor {
|
|||||||
while(current != null) {
|
while(current != null) {
|
||||||
id = getSnapshotId(current);
|
id = getSnapshotId(current);
|
||||||
String numDisksStr = _properties.getProperty(String.format("snapshot%d.numDisks", id));
|
String numDisksStr = _properties.getProperty(String.format("snapshot%d.numDisks", id));
|
||||||
assert(numDisksStr != null);
|
int numDisks = 0;
|
||||||
int numDisks = Integer.parseInt(numDisksStr);
|
if(numDisksStr != null && !numDisksStr.isEmpty()) {
|
||||||
|
numDisks = Integer.parseInt(numDisksStr);
|
||||||
DiskInfo[] disks = new DiskInfo[numDisks];
|
DiskInfo[] disks = new DiskInfo[numDisks];
|
||||||
for(int i = 0; i < numDisks; i++) {
|
for(int i = 0; i < numDisks; i++) {
|
||||||
disks[i] = new DiskInfo(
|
disks[i] = new DiskInfo(
|
||||||
@ -191,6 +192,7 @@ public class SnapshotDescriptor {
|
|||||||
info.setDisks(disks);
|
info.setDisks(disks);
|
||||||
info.setDisplayName(_properties.getProperty(String.format("snapshot%d.displayName", id)));
|
info.setDisplayName(_properties.getProperty(String.format("snapshot%d.displayName", id)));
|
||||||
l.add(info);
|
l.add(info);
|
||||||
|
}
|
||||||
|
|
||||||
current = _properties.getProperty(String.format("snapshot%d.parent", id));
|
current = _properties.getProperty(String.format("snapshot%d.parent", id));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user