From f8fa6596427d2970d67ab2b9c06ef1e0d8ba57df Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 15 Mar 2019 15:26:41 -0400 Subject: [PATCH] fix don't crash if settings are not passed in --- src/socket.io/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket.io/user.js b/src/socket.io/user.js index add94f3804..c8d473ef03 100644 --- a/src/socket.io/user.js +++ b/src/socket.io/user.js @@ -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]]')); }