mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: handle missing uid in deprecated socket call
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user