ONOS-1950 - NPE if intent state is null
Change-Id: I5e93cf57f3c881e5528e3ac522f95451fab70fba
Showing
1 changed file
with
3 additions
and
1 deletions
| ... | @@ -49,7 +49,9 @@ public final class IntentCodec extends JsonCodec<Intent> { | ... | @@ -49,7 +49,9 @@ public final class IntentCodec extends JsonCodec<Intent> { |
| 49 | 49 | ||
| 50 | IntentService service = context.getService(IntentService.class); | 50 | IntentService service = context.getService(IntentService.class); |
| 51 | IntentState state = service.getIntentState(intent.key()); | 51 | IntentState state = service.getIntentState(intent.key()); |
| 52 | - result.put("state", state.toString()); | 52 | + if (state != null) { |
| 53 | + result.put("state", state.toString()); | ||
| 54 | + } | ||
| 53 | 55 | ||
| 54 | return result; | 56 | return result; |
| 55 | } | 57 | } | ... | ... |
-
Please register or login to post a comment