Skip to content

Commit

Permalink
Only allow item selection if orgs are non-empty
Browse files Browse the repository at this point in the history
The org count being empty means they did not successfully
load so don't allow further navigation in this case.
  • Loading branch information
kevinsawicki committed Sep 17, 2012
1 parent 8d1a5b8 commit bea5c05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId) {
if (homeAdapter.isOrgPosition(itemPosition)) {
homeAdapter.setSelected(itemPosition);
setOrg(orgs.get(itemPosition));
} else {
} else if (homeAdapter.getOrgCount() > 0) {
switch (homeAdapter.getAction(itemPosition)) {
case ACTION_GISTS:
startActivity(new Intent(this, GistsActivity.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public HomeDropdownListAdapter(final Context context,
*
* @return org count
*/
private int getOrgCount() {
public int getOrgCount() {
return getCount() - NON_ORG_ITEMS;
}

Expand Down

0 comments on commit bea5c05

Please sign in to comment.