Send 404 if applink icon does not exist
This commit is contained in:
@@ -84,6 +84,7 @@ async function getIcon(req, res, next) {
|
|||||||
|
|
||||||
const [error, icon] = await safe(applinks.getIcon(req.params.id, { original: req.query.original }));
|
const [error, icon] = await safe(applinks.getIcon(req.params.id, { original: req.query.original }));
|
||||||
if (error) return next(BoxError.toHttpError(error));
|
if (error) return next(BoxError.toHttpError(error));
|
||||||
|
if (!icon) return next(new HttpError(404, 'no such icon'));
|
||||||
|
|
||||||
res.send(icon);
|
res.send(icon);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user