Skip to content

Commit e178700

Browse files
cco3Android Code Review
authored andcommitted
Merge "Added null check on return value for getKeyDispatcherState()"
2 parents 501f7bc + 4ae02b3 commit e178700

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/android/widget/PopupWindow.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,10 @@ protected int[] onCreateDrawableState(int extraSpace) {
14211421
@Override
14221422
public boolean dispatchKeyEvent(KeyEvent event) {
14231423
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
1424+
if (getKeyDispatcherState() == null) {
1425+
return super.dispatchKeyEvent(event);
1426+
}
1427+
14241428
if (event.getAction() == KeyEvent.ACTION_DOWN
14251429
&& event.getRepeatCount() == 0) {
14261430
getKeyDispatcherState().startTracking(event, this);

0 commit comments

Comments
 (0)