forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-33868 Gradbook Classic GradeEvent returns null vs empty list (sak…
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,7 @@ | |
* @author <a href="mailto:[email protected]">Josh Holtzman</a> | ||
*/ | ||
public class GradingEvents implements Serializable { | ||
protected Map<String, List<GradingEvent>> studentsToEventsMap; | ||
|
||
public GradingEvents() { | ||
studentsToEventsMap = new HashMap<>(); | ||
} | ||
private Map<String, List<GradingEvent>> studentsToEventsMap = new HashMap<>(); | ||
|
||
/** | ||
* Returns a list of grading events, which may be empty if none exist. | ||
|
@@ -40,7 +36,11 @@ public GradingEvents() { | |
* @return | ||
*/ | ||
public List<GradingEvent> getEvents(String studentId) { | ||
return studentsToEventsMap.get(studentId); | ||
List<GradingEvent> list = studentsToEventsMap.get(studentId); | ||
if (list == null) { | ||
list = new ArrayList<>(); | ||
} | ||
return list; | ||
} | ||
|
||
public void addEvent(GradingEvent event) { | ||
|