Skip to content

Commit e520525

Browse files
authored
Use parameter dcId as wrapper to prevent NPE (#8986)
1 parent aad410a commit e520525

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ public interface EndPointSelector {
4747

4848
EndPoint select(DataStore store, String downloadUrl);
4949

50-
EndPoint findSsvm(long dcId);
50+
EndPoint findSsvm(Long dcId);
5151
}

engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
338338
* Finds an SSVM that can be used to execute a command.
339339
* For zone-wide image store, use SSVM for that zone. For region-wide store, we can arbitrarily pick one SSVM to do the task.
340340
* */
341-
public EndPoint findSsvm(long dcId) {
341+
@Override
342+
public EndPoint findSsvm(Long dcId) {
342343
List<HostVO> ssAHosts = listUpAndConnectingSecondaryStorageVmHost(dcId);
343344
if (ssAHosts == null || ssAHosts.isEmpty()) {
344345
return null;

0 commit comments

Comments
 (0)