diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfOvirtReader.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfOvirtReader.java index 1ca96f60ccd..e1df7436a4c 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfOvirtReader.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfOvirtReader.java @@ -260,10 +260,10 @@ public void buildDisk() { protected void readDisk(XmlNode node, DiskImage image) { super.readDisk(node, image); - if (!StringUtils.isEmpty(node.attributes.get("ovf:size").getValue())) { + if (node.attributes.get("ovf:size") != null && !StringUtils.isEmpty(node.attributes.get("ovf:size").getValue())) { image.setSize(convertGigabyteToBytes(Long.parseLong(node.attributes.get("ovf:size").getValue()))); } - if (!StringUtils.isEmpty(node.attributes.get("ovf:actual_size").getValue())) { + if (node.attributes.get("ovf:actual_size") != null && !StringUtils.isEmpty(node.attributes.get("ovf:actual_size").getValue())) { image.setActualSizeInBytes( convertGigabyteToBytes(Long.parseLong(node.attributes.get("ovf:actual_size").getValue()))); }