commit | ccab22dbc6ff23fcd2ea9a3f82e845199c6b8341 | [log] [tgz] |
---|---|---|
author | Ray Milkey <ray@onlab.us> | Mon May 18 13:24:50 2015 -0700 |
committer | Ray Milkey <ray@onlab.us> | Mon May 18 13:24:50 2015 -0700 |
tree | d9784b9acc9b75695e2c0bffa89ac3ba76d3b468 | |
parent | 24fe16a7824e9c0c69956baadd55f12953dafb62 [diff] |
ONOS-1950 - NPE if intent state is null Change-Id: I5e93cf57f3c881e5528e3ac522f95451fab70fba
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/IntentCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/IntentCodec.java index 6b50718..a45ae87 100644 --- a/core/common/src/main/java/org/onosproject/codec/impl/IntentCodec.java +++ b/core/common/src/main/java/org/onosproject/codec/impl/IntentCodec.java
@@ -49,7 +49,9 @@ IntentService service = context.getService(IntentService.class); IntentState state = service.getIntentState(intent.key()); - result.put("state", state.toString()); + if (state != null) { + result.put("state", state.toString()); + } return result; }