CLOUDSTACK-3879 [VMware] NPE while attempting to create template from volume

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-07-27 16:59:26 +05:30
parent 081ba92497
commit 3adeb12d2f

View File

@ -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<String> filenames = new ArrayList<String>();
for (int i = 0; i < ssfiles.length; i++) {
String vmdkfile = ssfiles[i].getName();