fix: handle missing uid in deprecated socket call

isekai-main
Julian Lam 3 years ago
parent 0a41741b7e
commit cdaea61136

@ -8,6 +8,10 @@ const api = require('../../api');
module.exports = function (SocketUser) {
SocketUser.changePicture = async function (socket, data) {
if (!socket.uid) {
throw new Error('[[error:invalid-uid]]');
}
websockets.warnDeprecated(socket, 'PUT /api/v3/users/:uid/picture');
await api.users.changePicture(socket, data);
};

Loading…
Cancel
Save