Skip to content

Commit 22fef8a

Browse files
committed
optional chaining
1 parent 57172f5 commit 22fef8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/tasks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const updateTask = async (req, res) => {
178178
if (!task.taskData) {
179179
return res.boom.notFound("Task not found");
180180
}
181-
if (req.body.assignee) {
181+
if (req.body?.assignee) {
182182
const user = await userQuery.fetchUser({ username: req.body.assignee });
183183
if (!user.userExists) {
184184
return res.boom.notFound("User doesn't exist");

0 commit comments

Comments
 (0)