comparison src/com/five_ten_sg/connectbot/HostEditorActivity.java @ 137:37665a94fc39

listpref value may be null
author Carl Byington <carl@five-ten-sg.com>
date Fri, 20 Jun 2014 11:05:04 -0700
parents adf9ca45675b
children 071eccdff8ea
comparison
equal deleted inserted replaced
136:398503d13f35 137:37665a94fc39
353 } 353 }
354 catch (NumberFormatException nfe) { 354 catch (NumberFormatException nfe) {
355 // Fall through. 355 // Fall through.
356 } 356 }
357 } 357 }
358 else if (pref instanceof ListPreference) { 358 else if ((pref instanceof ListPreference) && (value != null)) {
359 ListPreference listPref = (ListPreference) pref; 359 ListPreference listPref = (ListPreference) pref;
360 int entryIndex = listPref.findIndexOfValue(value.toString()); 360 int entryIndex = listPref.findIndexOfValue(value.toString());
361 if (entryIndex >= 0) value = listPref.getEntries()[entryIndex]; 361 if (entryIndex >= 0) value = listPref.getEntries()[entryIndex];
362 } 362 }
363 363