Added safegaurd against invalid project id in the method getFileContent

This commit is contained in:
Mayank Gautam 2020-02-17 22:26:16 +05:30 committed by Cassie Tarakajian
parent f1dd9f44ef
commit 8754848699

View file

@ -111,7 +111,7 @@ export function deleteFile(req, res) {
export function getFileContent(req, res) {
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.' });
return;
}