Skip to content

Commit

Permalink
fix: catch get-orientation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Sep 17, 2021
1 parent dd84f85 commit d1ca17d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/src/controllers/train.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ module.exports.get = async (req, res) => {

const key = `train/${name}/${filename}`;
const { width, height } = await sizeOf(`${STORAGE.PATH}/${key}`);
const orientation = await getOrientation(fs.readFileSync(`${STORAGE.PATH}/${key}`));
const orientation = await getOrientation(fs.readFileSync(`${STORAGE.PATH}/${key}`)).catch(
(/* error */) => 0
);

const output = {
id,
Expand Down

0 comments on commit d1ca17d

Please sign in to comment.