Skip to content

Commit

Permalink
fix speedgrader crash with post policies if no submission object
Browse files Browse the repository at this point in the history
fixes GRADE-2292

test plan:
 - Have a course with an assignment and a few students
 - In the rails console, delete the submission object for one of the
   students.
 - Note that speedgrader loads normally

Change-Id: I14949ba8e1f033475afd0b9d8e9ffdf39d12e2c7
Reviewed-on: https://gerrit.instructure.com/201125
Tested-by: Jenkins
QA-Review: Keith Garner <[email protected]>
Product-Review: Keith Garner <[email protected]>
Reviewed-by: Gary Mei <[email protected]>
Reviewed-by: Adrian Packel <[email protected]>
  • Loading branch information
ktgeek committed Jul 13, 2019
1 parent 4d5d878 commit 32b2070
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/javascripts/speed_grader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3688,8 +3688,8 @@ function teardownSettingsMenu() {
function renderPostGradesMenu() {
const {submissionsMap} = window.jsonData
const submissions = window.jsonData.studentsWithSubmissions.map(student => student.submission)
const allowHidingGrades = submissions.some(submission => submission.posted_at != null)
const allowPostingGrades = submissions.some(submission => submission.posted_at == null)
const allowHidingGrades = submissions.some(submission => submission && submission.posted_at != null)
const allowPostingGrades = submissions.some(submission => submission && submission.posted_at == null)

function onHideGrades() {
EG.postPolicies.showHideAssignmentGradesTray({submissionsMap})
Expand Down

0 comments on commit 32b2070

Please sign in to comment.