commit | fc0922337aa843a6756f277a1e9e73e2a1c1c07c | [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:46:12 2020 +0530 |
tree | 012cee71c9982c222d4c71311a8ddef15c985114 | |
parent | fda8a8a2c716ad4781e9988f181b673a19988eb9 [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); }