Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3426 from mozilla-services/3401-array-check
Browse files Browse the repository at this point in the history
Ensure that `shots` is an array before calling `shots.map()` (#3401)
  • Loading branch information
ianb authored Aug 29, 2017
2 parents f300d64 + 75df157 commit d9ebbe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/pages/shotindex/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.createModel = function(req) {
image.url = createProxyUrl(req, image.url);
}
}
if (shots !== null && shots !== undefined) {
if (shots && shots.length) {
shots = shots.map((shot) => ({id: shot.id, json: shot.asRecallJson()}));
}
let jsonModel = Object.assign(
Expand Down

0 comments on commit d9ebbe4

Please sign in to comment.