Skip to content

Commit

Permalink
gwt: Gracefully handle the case where no assignments are visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
calin-iorgulescu committed Mar 10, 2015
1 parent 5166f6f commit 1e0249a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ public NumberedMenu(String[] itemsText) {
panel.add(item);
items.add(item);
}
/* initialize */
setSelectedIndex(0);
if (itemsText.length > 0) {
/* initialize */
setSelectedIndex(0);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ public void displayInfo(User user, Assignment[] assignments,
tablePanel.clear();

/* if there are no submissions to show, display the appropriate message. */
if (teamResultsInfo.size() == 0 && studentResultsInfo.size() == 0) {
if (assignments.length == 0 ||
(teamResultsInfo.size() == 0 && studentResultsInfo.size() == 0)) {
tablePanel.add(noSubmissionAvailableMessage);
return;
}
Expand Down

0 comments on commit 1e0249a

Please sign in to comment.