Skip to content

Commit

Permalink
Dirty fix for nullpointer exception - it seems like the Android is as…
Browse files Browse the repository at this point in the history
…king for nonexistent sections at the end of the list, so return 1 instead of null if no value is present in the map.
  • Loading branch information
rkallensee committed Jan 8, 2013
1 parent 2930ed4 commit 6f807b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/org/fosdem/util/EventAdapter.java
Expand Up @@ -126,7 +126,12 @@ public Object[] getSections() {
}

public int getPositionForSection(int section) {
return sectionPositionMap.get(Integer.valueOf(section));
Log.v("fooh", "foo: "+section);
Integer position = sectionPositionMap.get(Integer.valueOf(section));
if (position == null) {
return 1;
}
return position;
}

public int getSectionForPosition(int position) {
Expand Down

0 comments on commit 6f807b3

Please sign in to comment.