Skip to content

Commit

Permalink
SAM-2717 - Handle copy of null grading attachments
Browse files Browse the repository at this point in the history
There is a setter for the grading attachment list on
AssessmentGradingData, which wraps an underlying HashSet. When copying,
for example, from AgentResults, where there are no attachments, the
HashSet constructor on the null value throws an
InvocationTargetException, which obscured the problem. This change
creates a new, empty set if null is passed to this setter.
  • Loading branch information
botimer committed Mar 17, 2016
1 parent 778dc72 commit 49e9951
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,14 @@ public List<AssessmentGradingAttachment> getAssessmentGradingAttachmentList() {

public void setAssessmentGradingAttachmentList(
List<AssessmentGradingAttachment> assessmentGradingAttachmentList) {
Set<AssessmentGradingAttachment> assessmentGradingAttachmentSet = new HashSet<AssessmentGradingAttachment>(assessmentGradingAttachmentList);
Set<AssessmentGradingAttachment> assessmentGradingAttachmentSet = null;

if (assessmentGradingAttachmentList != null) {
assessmentGradingAttachmentSet = new HashSet<AssessmentGradingAttachment>(assessmentGradingAttachmentList);
} else {
assessmentGradingAttachmentSet = new HashSet<AssessmentGradingAttachment>();
}

this.assessmentGradingAttachmentSet = assessmentGradingAttachmentSet;
}

Expand Down

0 comments on commit 49e9951

Please sign in to comment.