Skip to content

Commit 35a9487

Browse files
committed
Chapter 8 bugfix
1 parent f59c0d0 commit 35a9487

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Chapter_08/learn-about-me/routes.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ router.post("/edit", ensureAuthenticated, function(req, res, next) {
9090
req.user.displayName = req.body.displayname;
9191
req.user.bio = req.body.bio;
9292
req.user.save(function(err) {
93-
if (err) { next(err); }
93+
if (err) {
94+
next(err);
95+
return;
96+
}
9497
req.flash("info", "Profile updated!");
9598
res.redirect("/edit");
9699
});

0 commit comments

Comments
 (0)