Skip to content

Commit

Permalink
fix prevent crash from user migrated profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Aug 15, 2015
1 parent 40ab7d2 commit dfb85e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/models/User-Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ export default function(UserIdent) {
userChanged = true;
}

if (!(/github/).test(provider)) {
if (!(/github/).test(provider) && profile) {
debug('setting social', provider, (/github/g).test(provider));
debug('profile username', profile.username);
user[provider] = profile.username;
}

// if user signed in with github refresh their info
if (/github/.test(provider)) {
if (/github/.test(provider) && profile && profile._json) {
debug("user isn't github cool or username from github is different");
setProfileFromGithub(user, profile, profile._json);
userChanged = true;
Expand Down

0 comments on commit dfb85e4

Please sign in to comment.