Brian O'Connor
Committed by Pavlin Radoslavov

temporary NPE fix for ONOS-439

[Merged from onos-1.0]

Change-Id: I238ea24e1a4c4bebb40d132d060c418f5675f570
(cherry picked from commit f25a5115)
......@@ -137,8 +137,14 @@ public class OpticalLinkProvider extends AbstractProvider implements LinkProvide
Port srcPort = deviceService.getPort(srcId, link.src().port());
Port dstPort = deviceService.getPort(dstId, link.dst().port());
if (srcPort == null || dstPort == null) {
return; //FIXME remove this in favor of below TODO
}
boolean active = deviceService.isAvailable(srcId) &&
deviceService.isAvailable(dstId) &&
// TODO: should update be queued if src or dstPort is null?
//srcPort != null && dstPort != null &&
srcPort.isEnabled() && dstPort.isEnabled();
LinkDescription desc = new DefaultLinkDescription(link.src(), link.dst(), OPTICAL);
......
......@@ -133,6 +133,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn
List<FlowRuleBatchEntry> rules = Lists.newLinkedList();
ConnectPoint prev = intent.src();
//FIXME check for null allocations
//TODO throw exception if the lambda was not assigned successfully
for (Link link : intent.path().links()) {
Lambda la = null;
......