From 3adeb12d2fff575603ac80fe8b176c68d813d24c Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Sat, 27 Jul 2013 16:59:26 +0530 Subject: [PATCH] CLOUDSTACK-3879 [VMware] NPE while attempting to create template from volume Signed-off-by: Sateesh Chodapuneedi --- .../com/cloud/storage/resource/VmwareStorageProcessor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java index 4df7eb4fd5d..65a0cb56596 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java @@ -855,6 +855,11 @@ public class VmwareStorageProcessor implements StorageProcessor { s_logger.info("vmdkfile parent dir: " + snapshotRoot); File snapshotdir = new File(snapshotRoot); File[] ssfiles = snapshotdir.listFiles(); + if (ssfiles == null) { + String msg = "unable to find snapshot vmdk files in " + snapshotRoot; + s_logger.error(msg); + throw new Exception(msg); + } // List filenames = new ArrayList(); for (int i = 0; i < ssfiles.length; i++) { String vmdkfile = ssfiles[i].getName();