Skip to content

Node.js based forum software built for the modern web

feat: throw error if uid is missing for update

Barış Soner Uşaklı1d3fa3bc4e7f
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 });