Ray Milkey
Committed by Gerrit Code Review

Fix NPE on shutdown if providers are already gone

Change-Id: I019786f26a589a5b82b72f736fa2d148571ea274
......@@ -74,7 +74,6 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.Futures;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.net.DefaultAnnotations.merge;
import static org.onosproject.net.DefaultAnnotations.union;
import static org.onosproject.net.Link.State.ACTIVE;
......@@ -353,7 +352,12 @@ public class ECLinkStore
private Link composeLink(LinkKey linkKey) {
ProviderId baseProviderId = checkNotNull(getBaseProviderId(linkKey));
ProviderId baseProviderId = getBaseProviderId(linkKey);
if (baseProviderId == null) {
// provider was not found, this means it was already removed by the
// parent component.
return null;
}
LinkDescription base = linkDescriptions.get(new Provided<>(linkKey, baseProviderId));
// short circuit if link description no longer exists
if (base == null) {
......