CLOUDSTACK-2515: Verify if the targetPath isn't null before comparing

This commit is contained in:
Wido den Hollander 2013-05-15 13:57:58 +02:00
parent 9b6513466f
commit 68a428f84d
1 changed files with 2 additions and 1 deletions

View File

@ -465,7 +465,8 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
StoragePool p = conn.storagePoolLookupByName(poolname);
LibvirtStoragePoolDef pdef = getStoragePoolDef(conn, p);
if (pdef.getTargetPath().equals(path)) {
String targetPath = pdef.getTargetPath();
if (targetPath != null && targetPath.equals(path)) {
s_logger.debug("Storage pool utilizing path '" + path + "' already exists as pool "
+ poolname + ", undefining so we can re-define with correct name " + name);
if (p.isPersistent() == 1) {