Comment 2 for bug 406878

robb1e (robert-clutton) wrote :

I managed to fix this by applying this patch to ImageManager.java

@@ -147,11 +147,17 @@
             db.clean();
         }

- ArrayList<String> ancestorIds = this.getAncestors(vmInfo.getOwnerId(), diskInfo.getImageLocation());
-
- // :: create the response assets now since we might not have a ramdisk anyway :://
- VmImageInfo vmImgInfo = new VmImageInfo(vmInfo.getImageId(), vmInfo.getKernelId(), vmInfo.getRamdiskId(), diskUrl, null, null, productCodes);
- vmImgInfo.setAncestorIds(ancestorIds);
+ VmImageInfo vmImgInfo;
+ if (null != diskInfo && null != diskUrl){
+ ArrayList<String> ancestorIds = this.getAncestors(vmInfo.getOwnerId(), diskInfo.getImageLocation());
+
+ // :: create the response assets now since we might not have a ramdisk anyway :://
+ vmImgInfo = new VmImageInfo(vmInfo.getImageId(), vmInfo.getKernelId(), vmInfo.getRamdiskId(), diskUrl, null, null, productCodes);
+ vmImgInfo.setAncestorIds(ancestorIds);
+ } else {
+ vmImgInfo = new VmImageInfo(vmInfo.getImageId(), vmInfo.getKernelId(), vmInfo.getRamdiskId(), "", null, null, productCodes);
+ vmImgInfo.setAncestorIds(new ArrayList<String>());
+ }
         return vmImgInfo;
     }