commit | a8c930ec4f2db2600822feb55c163a2905e7623d | [log] [tgz] |
---|---|---|
author | Anurag Chadha <anurag.chadha@hsc.com> | Fri Aug 28 15:18:03 2020 +0530 |
committer | Anurag Chadha <anurag.chadha@hsc.com> | Thu Sep 03 16:48:36 2020 +0530 |
tree | 77e33e2d9ca42735f65b92250149635e0eb700fe | |
parent | 6b132130951c7eb7fa8dbf0fc7f001c6ba655aed [diff] |
[ONOS-8115] Fix for NPE while adding annotations for device using netcfg Change-Id: Ia30499b969a984e8580474a810a306f96b56879a
diff --git a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java index b114d0c..e40b14d 100644 --- a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java +++ b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
@@ -1144,7 +1144,9 @@ DeviceDescription desc = (dev == null) ? null : BasicDeviceOperator.descriptionOf(dev); Optional<Config> prevConfig = event.prevConfig(); - desc = deviceAnnotationOp.combine(did, desc, prevConfig); + if (desc != null) { // Fix for NPE due to desc being null + desc = deviceAnnotationOp.combine(did, desc, prevConfig); + } if (desc != null && dp != null) { store.createOrUpdateDevice(dp.id(), did, desc); }