commit | e2eeae877c97c684916d0982dbf5b75c703e1784 | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@ak.jp.nec.com> | Thu Jul 28 13:56:31 2016 -0700 |
committer | Ray Milkey <ray@onlab.us> | Fri Jul 29 15:53:50 2016 +0000 |
tree | 26a31c377225970fdc9b9bba5264343152789a19 | |
parent | db67355aaf6a2a484e5675a47287eef9165f3062 [diff] |
Avoid NPE when IntentData was not found. Change-Id: I3cb67c1ad487c8b546056a35ef0412e41d8e4fb1
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java index 191bec2..6c0b34a 100644 --- a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java +++ b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java
@@ -205,7 +205,9 @@ @Override public IntentState getIntentState(Key intentKey) { checkNotNull(intentKey, KEY_NULL); - return store.getIntentData(intentKey).state(); + return Optional.ofNullable(store.getIntentData(intentKey)) + .map(IntentData::state) + .orElse(null); } @Override