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 ...@@ -137,8 +137,14 @@ public class OpticalLinkProvider extends AbstractProvider implements LinkProvide
137 Port srcPort = deviceService.getPort(srcId, link.src().port()); 137 Port srcPort = deviceService.getPort(srcId, link.src().port());
138 Port dstPort = deviceService.getPort(dstId, link.dst().port()); 138 Port dstPort = deviceService.getPort(dstId, link.dst().port());
139 139
140 + if (srcPort == null || dstPort == null) {
141 + return; //FIXME remove this in favor of below TODO
142 + }
143 +
140 boolean active = deviceService.isAvailable(srcId) && 144 boolean active = deviceService.isAvailable(srcId) &&
141 deviceService.isAvailable(dstId) && 145 deviceService.isAvailable(dstId) &&
146 + // TODO: should update be queued if src or dstPort is null?
147 + //srcPort != null && dstPort != null &&
142 srcPort.isEnabled() && dstPort.isEnabled(); 148 srcPort.isEnabled() && dstPort.isEnabled();
143 149
144 LinkDescription desc = new DefaultLinkDescription(link.src(), link.dst(), OPTICAL); 150 LinkDescription desc = new DefaultLinkDescription(link.src(), link.dst(), OPTICAL);
......
...@@ -133,6 +133,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn ...@@ -133,6 +133,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn
133 List<FlowRuleBatchEntry> rules = Lists.newLinkedList(); 133 List<FlowRuleBatchEntry> rules = Lists.newLinkedList();
134 ConnectPoint prev = intent.src(); 134 ConnectPoint prev = intent.src();
135 135
136 + //FIXME check for null allocations
136 //TODO throw exception if the lambda was not assigned successfully 137 //TODO throw exception if the lambda was not assigned successfully
137 for (Link link : intent.path().links()) { 138 for (Link link : intent.path().links()) {
138 Lambda la = null; 139 Lambda la = null;
......