Committed by
Ray Milkey
Avoid NPE when IntentData was not found.
Change-Id: I3cb67c1ad487c8b546056a35ef0412e41d8e4fb1
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -205,7 +205,9 @@ public class VirtualNetworkIntentService extends AbstractListenerManager<IntentE | ... | @@ -205,7 +205,9 @@ public class VirtualNetworkIntentService extends AbstractListenerManager<IntentE |
205 | @Override | 205 | @Override |
206 | public IntentState getIntentState(Key intentKey) { | 206 | public IntentState getIntentState(Key intentKey) { |
207 | checkNotNull(intentKey, KEY_NULL); | 207 | checkNotNull(intentKey, KEY_NULL); |
208 | - return store.getIntentData(intentKey).state(); | 208 | + return Optional.ofNullable(store.getIntentData(intentKey)) |
209 | + .map(IntentData::state) | ||
210 | + .orElse(null); | ||
209 | } | 211 | } |
210 | 212 | ||
211 | @Override | 213 | @Override | ... | ... |
-
Please register or login to post a comment