Skip to content

Commit 5d4c251

Browse files
fix npe while checking storage uri scheme
1 parent 00a6bf5 commit 5d4c251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public KVMStoragePool getStoragePoolByURI(String uri) {
296296
String uuid = null;
297297
String sourceHost = "";
298298
StoragePoolType protocol = null;
299-
final String scheme = storageUri.getScheme().toLowerCase();
299+
final String scheme = (storageUri.getScheme() != null) ? storageUri.getScheme().toLowerCase() : "";
300300
List<String> acceptedSchemes = List.of("nfs", "networkfilesystem", "filesystem");
301301
if (acceptedSchemes.contains(scheme)) {
302302
sourcePath = storageUri.getPath();

0 commit comments

Comments
 (0)