mirror of https://github.com/calzoneman/sync.git
Fix regression for user profiles
This commit is contained in:
parent
35a8e2b52a
commit
014eb28e0d
|
@ -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]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue