fix don't crash if settings are not passed in

This commit is contained in:
Baris Usakli
2019-03-15 15:26:41 -04:00
parent 7addc5a0e2
commit f8fa659642

View File

@@ -219,7 +219,7 @@ function toggleFollow(method, uid, theiruid, callback) {
}
SocketUser.saveSettings = function (socket, data, callback) {
if (!socket.uid || !data) {
if (!socket.uid || !data || !data.settings) {
return callback(new Error('[[error:invalid-data]]'));
}