Fixed race condition in Spinner.DialogPopup on null reference.

NullPointerException is triggered when DialogPopup is
dismissed due to object mPopup being null when not showing.
Race condition is triggered when dialog is dismissed before
touch event to dismiss dialog has been processed properly.

Fixed by adding a null check prior to accessing mPopup object.

Change-Id: I3c4fe9c279d92a7103fb4f68189d1d42beedc606
This commit is contained in:
Daniel 2 Olofsson
2013-06-10 14:49:14 +02:00
committed by Henrik Baard
parent fa42e774bc
commit 2f77f9c03e

View File

@@ -837,8 +837,10 @@ public class Spinner extends AbsSpinner implements OnClickListener {
private CharSequence mPrompt;
public void dismiss() {
mPopup.dismiss();
mPopup = null;
if (mPopup != null) {
mPopup.dismiss();
mPopup = null;
}
}
public boolean isShowing() {