Skip to content

Commit

Permalink
dixed problem when HIT has no assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Sep 28, 2011
1 parent cd3a922 commit 4f3e356
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion model/hit.js
Expand Up @@ -230,7 +230,11 @@ module.exports = function(config) {
totalNumResults = parseInt(response.GetAssignmentsForHITResult.TotalNumResults, 10);

resultAssignments = response.GetAssignmentsForHITResult.Assignment;
if (! Array.isArray(resultAssignments)) resultAssignments = [resultAssignments];
if (resultAssignments === undefined) {
resultAssignments = [];
} else {
if (! Array.isArray(resultAssignments)) resultAssignments = [resultAssignments];
}

assignments = resultAssignments.map(function(resultAssignment) {
var assignment = new Assignment();
Expand Down

0 comments on commit 4f3e356

Please sign in to comment.