Skip to content

Commit dd39393

Browse files
author
Daman Arora
committed
Skip null or missing URLs for S3
1 parent 387f958 commit dd39393

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,10 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl
12471247
protected void addSecondaryStorageServerAddressToBuffer(StringBuilder buffer, List<DataStore> dataStores, String vmName) {
12481248
List<String> addresses = new ArrayList<>();
12491249
for (DataStore dataStore: dataStores) {
1250+
// S3 and other object stores may not have a URL, so better to skip them
1251+
if (dataStore == null || dataStore.getTO() == null || dataStore.getTO().getUrl() == null) {
1252+
continue;
1253+
}
12501254
String url = dataStore.getTO().getUrl();
12511255
String[] urlArray = url.split("/");
12521256

0 commit comments

Comments
 (0)