Added safegaurd against invalid project id in the method getFileContent
This commit is contained in:
parent
ab7f4279bd
commit
b1d558b3fc
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ export function deleteFile(req, res) {
|
||||||
|
|
||||||
export function getFileContent(req, res) {
|
export function getFileContent(req, res) {
|
||||||
Project.findById(req.params.project_id, (err, project) => {
|
Project.findById(req.params.project_id, (err, project) => {
|
||||||
if (err) {
|
if (err || project == null) {
|
||||||
res.status(404).send({ success: false, message: 'Project with that id does not exist.' });
|
res.status(404).send({ success: false, message: 'Project with that id does not exist.' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue