Skip to content

Commit

Permalink
fix(user): crash fix for undefined title
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Sep 20, 2018
1 parent 6929cc1 commit 5e2b38c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ userSchema.pre('save', function(next) {
var user = this;

user.username = user.username.trim();
user.title = user.title.trim();
user.email = user.email.trim();
user.fullname = user.fullname.trim();
if (user.fullname) user.fullname = user.fullname.trim();
if (user.title) user.title = user.title.trim();

if (!user.isModified('password'))
return next();
Expand Down
3 changes: 1 addition & 2 deletions src/public/js/angularjs/controllers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,8 @@ define(['angular', 'underscore', 'jquery', 'modules/helpers', 'modules/ui', 'uik
$target.find('ul>li[data-key]').first().addClass('active');


if (settings === 'settings-legal' && privacyPolicyMDE) {
if (settings === 'settings-legal' && privacyPolicyMDE)
privacyPolicyMDE.codemirror.refresh();
}
}
}
};
Expand Down

0 comments on commit 5e2b38c

Please sign in to comment.