Skip to content

Commit 8754848

Browse files
thegitone23catarak
authored andcommitted
Added safegaurd against invalid project id in the method getFileContent
1 parent f1dd9f4 commit 8754848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/controllers/file.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function deleteFile(req, res) {
111111

112112
export function getFileContent(req, res) {
113113
Project.findById(req.params.project_id, (err, project) => {
114-
if (err) {
114+
if (err || project == null) {
115115
res.status(404).send({ success: false, message: 'Project with that id does not exist.' });
116116
return;
117117
}

0 commit comments

Comments
 (0)