commit | 15551272ca0b49ef4b116533678ac6de7f173b68 | [log] [tgz] |
---|---|---|
author | Ray Milkey <ray@onlab.us> | Wed Feb 10 16:22:02 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Thu Feb 11 02:33:46 2016 +0000 |
tree | 289f6e9c9a324f4c56302b1b85b2d87dec0ae6d3 | |
parent | 17711e5a30ccdd9a769d5984cfcb4b1cb8cbebc0 [diff] |
Fix NPE when setting strict if there are no links present Change-Id: Ic43d8807d5d2a86a3f716214c7fcf5a00f1e9477
diff --git a/core/store/dist/src/main/java/org/onosproject/store/link/impl/ECLinkStore.java b/core/store/dist/src/main/java/org/onosproject/store/link/impl/ECLinkStore.java index 845518e..9859e37 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/link/impl/ECLinkStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/link/impl/ECLinkStore.java
@@ -493,8 +493,12 @@ if (linkDiscoveryMode == LinkDiscoveryMode.STRICT) { // Remove any previous links to force them to go through the strict // discovery process - linkDescriptions.clear(); - links.clear(); + if (linkDescriptions != null) { + linkDescriptions.clear(); + } + if (links != null) { + links.clear(); + } } log.debug("config set link discovery mode to {}", linkDiscoveryMode.name());