Skip to content

Commit

Permalink
add check for undefined waiver field
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyleal committed Jul 31, 2024
1 parent f569678 commit 80706d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/middlewares/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ router.post('/upload-waiver', (req, res) => {
req.file.originalname,
)}`;

if (!user.waiver) {
user.waiver = {};
}

// save to MongoDB
user.waiver = {
filename,
Expand Down

0 comments on commit 80706d0

Please sign in to comment.