From a8c77bca885df6d02b6e66d369acf975aacd6d7e Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 17 Oct 2012 07:01:01 -0700 Subject: [PATCH] fix NPE --- .../src/org/eehouse/android/xw4/GameConfig.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java index 3ed8fab2e..db58ff5b9 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java @@ -824,10 +824,12 @@ public class GameConfig extends XWActivity ArrayAdapter adapter, String sel ) { - for ( int ii = 0; ii < adapter.getCount(); ++ii ) { - if ( sel.equals( adapter.getItem(ii) ) ) { - spinner.setSelection( ii ); - break; + if ( null != sel ) { + for ( int ii = 0; ii < adapter.getCount(); ++ii ) { + if ( sel.equals( adapter.getItem(ii) ) ) { + spinner.setSelection( ii ); + break; + } } } }