diff --git a/src/database/accounts.js b/src/database/accounts.js index 469a71c7..ce9a44a4 100644 --- a/src/database/accounts.js +++ b/src/database/accounts.js @@ -83,6 +83,15 @@ module.exports = { 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]); }); },