From 1d3fa3bc4e7f6f4b38c6478e74e486c06f4d3441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 15 May 2020 15:23:01 -0400 Subject: [PATCH] feat: throw error if uid is missing for update --- src/user/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/user/profile.js b/src/user/profile.js index 2b6a59e025..4eea3ee22a 100644 --- a/src/user/profile.js +++ b/src/user/profile.js @@ -16,7 +16,9 @@ module.exports = function (User) { 'username', 'email', 'fullname', 'website', 'location', 'groupTitle', 'birthday', 'signature', 'aboutme', ]; - + if (!data.uid) { + throw new Error('[[error:invalid-update-uid]]'); + } const updateUid = data.uid; const result = await plugins.fireHook('filter:user.updateProfile', { uid: uid, data: data, fields: fields });