It throws a NullPointerException when vserver has no l-interfaces
Issue-ID: SO-3924
Change-Id: I5e4116ead0775dd53b92414b9badfa09fe58779e
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
}
public static List<String> extractPciIdsFromVServer(Vserver vserver) {
+ if (vserver.getLInterfaces() == null) {
+ return Collections.emptyList();
+ }
return vserver.getLInterfaces().getLInterface().stream()
.filter(lInterface -> lInterface.getSriovVfs() != null
&& CollectionUtils.isNotEmpty(lInterface.getSriovVfs().getSriovVf()))