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

Commit

Permalink
Ensure that shots is an array before calling shots.map() (#3401)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhirsch committed Aug 29, 2017
1 parent 9c35009 commit 75df157
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 75df157

Please sign in to comment.