Fix regression for user profiles

This commit is contained in:
Calvin Montgomery 2016-10-01 21:37:42 -07:00
parent 35a8e2b52a
commit 014eb28e0d
1 changed files with 9 additions and 0 deletions

View File

@ -83,6 +83,15 @@ module.exports = {
return callback("User does not exist"); return callback("User does not exist");
} }
try {
var profile = JSON.parse(rows[0].profile);
profile.image = profile.image || "";
profile.text = profile.text || "";
rows[0].profile = profile;
} catch (error) {
rows[0].profile = { image: "", text: "" };
}
callback(null, rows[0]); callback(null, rows[0]);
}); });
}, },