* Sort setting - catched possible integer parse error.

This commit is contained in:
LevelX2 2014-02-18 01:08:09 +01:00
parent a38da25f69
commit 724d84c532

View file

@ -52,7 +52,11 @@ public abstract class SortSetting {
this.prefSortAscending = prefSortAscending;
this.prefPilesToggle = prefPilesToggle;
this.sortBy = SortBy.getByString(PreferencesDialog.getCachedValue(this.prefSortBy, "Color"));
this.sortIndex = Integer.parseInt(PreferencesDialog.getCachedValue(this.prefSortIndex, "1"));
try {
this.sortIndex = Integer.parseInt(PreferencesDialog.getCachedValue(this.prefSortIndex, "1"));
} catch (NumberFormatException e) {
this.sortIndex = 2;
}
this.ascending = PreferencesDialog.getCachedValue(this.prefSortAscending, "1").equals("1");
this.pilesToggle = PreferencesDialog.getCachedValue(this.prefPilesToggle, "true").equals("true");
}