commit | 8299dc9b0c5aed83536a1d3b180f64b0212edb8e | [log] [tgz] |
---|---|---|
author | Ray Milkey <ray@opennetworking.org> | Tue May 08 11:35:45 2018 -0700 |
committer | Ray Milkey <ray@opennetworking.org> | Tue May 08 11:35:45 2018 -0700 |
tree | 19da895457cc5cd2e8de73acab134ed7e254eecc | |
parent | 1012d7bfa907aeeb49609cd0e7d11a7d42f3aaf8 [diff] |
Fix NPE if group not found when removing buckets Change-Id: I732b84e8b0a3dc73a52dec02a82876f89e23fb5a
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2GroupHandler.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2GroupHandler.java index 40aad0d..7c1564e 100644 --- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2GroupHandler.java +++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2GroupHandler.java
@@ -1453,6 +1453,10 @@ //first group key is the one we want to modify GroupKey modGroupKey = chainsToRemove.get(0).peekFirst(); Group modGroup = groupService.getGroup(deviceId, modGroupKey); + if (modGroup == null) { + log.warn("removeBucket(): Attempt to modify non-existent group {} for device {}", modGroupKey, deviceId); + return; + } for (Deque<GroupKey> foundChain : chainsToRemove) { //second group key is the one we wish to remove the reference to if (foundChain.size() < 2) {