Use parameter dcId as wrapper to prevent NPE (#8986)

This commit is contained in:
dahn 2024-05-01 09:12:36 +02:00 committed by GitHub
parent aad410ae6c
commit e520525fe7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -47,5 +47,5 @@ public interface EndPointSelector {
EndPoint select(DataStore store, String downloadUrl);
EndPoint findSsvm(long dcId);
EndPoint findSsvm(Long dcId);
}

View File

@ -338,7 +338,8 @@ public class DefaultEndPointSelector implements EndPointSelector {
* Finds an SSVM that can be used to execute a command.
* For zone-wide image store, use SSVM for that zone. For region-wide store, we can arbitrarily pick one SSVM to do the task.
* */
public EndPoint findSsvm(long dcId) {
@Override
public EndPoint findSsvm(Long dcId) {
List<HostVO> ssAHosts = listUpAndConnectingSecondaryStorageVmHost(dcId);
if (ssAHosts == null || ssAHosts.isEmpty()) {
return null;