Fix NPE in FlowObjectiveManager when unregistering pipeconf drivers
The DriverManager was returning null instead of generating an
ItemNotFound exception as expected.
Change-Id: I4da6e07bfc3793ac0184cae40ce7f39b398e97f1
(cherry picked from commit 363660d96196c6da3b39b817bc7a8cb43df19330)
diff --git a/core/net/src/main/java/org/onosproject/net/driver/impl/DriverManager.java b/core/net/src/main/java/org/onosproject/net/driver/impl/DriverManager.java
index 8990822..31032b3 100644
--- a/core/net/src/main/java/org/onosproject/net/driver/impl/DriverManager.java
+++ b/core/net/src/main/java/org/onosproject/net/driver/impl/DriverManager.java
@@ -121,9 +121,12 @@
// Special processing for devices with pipeconf.
if (pipeconfService.ofDevice(deviceId).isPresent()) {
- // No fallback for pipeconf merged drivers. Returns null if driver
- // does not exist.
- return getPipeconfMergedDriver(deviceId);
+ // No fallback for pipeconf merged drivers.
+ // Throws exception if pipeconf driver does not exist.
+ return nullIsNotFound(
+ getPipeconfMergedDriver(deviceId),
+ "Device is pipeconf-capable but a " +
+ "pipeconf-merged driver was not found");
}
// Primary source of driver configuration is the network config.