Skip to content

Commit 7b2294d

Browse files
authored
Use StringUtils to check for empty path
1 parent 15142ab commit 7b2294d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import javax.xml.parsers.DocumentBuilder;
2323
import javax.xml.parsers.ParserConfigurationException;
2424

25+
import com.cloud.utils.StringUtils;
2526
import org.apache.cloudstack.utils.security.ParserUtils;
2627
import org.apache.logging.log4j.Logger;
2728
import org.apache.logging.log4j.LogManager;
@@ -50,7 +51,7 @@ public String getBackingFileNameIfExists(String volXML) {
5051
NodeList pathNodes = backingStore.getElementsByTagName("path");
5152
if (pathNodes.getLength() > 0) {
5253
String path = pathNodes.item(0).getTextContent();
53-
if (path == null || path.trim().isEmpty()) {
54+
if (StringUtils.isEmpty(path)) {
5455
return null;
5556
}
5657
path = path.trim();

0 commit comments

Comments
 (0)