users: do nothing when nothing to update

This commit is contained in:
Girish Ramakrishnan
2025-02-13 17:28:02 +01:00
parent 221181092e
commit 5459a540e7

View File

@@ -642,6 +642,7 @@ async function update(user, data, auditSource) {
args.push(data[k]);
}
}
if (args.length == 0) return; // nothing to do
args.push(user.id);
const [error, result] = await safe(database.query('UPDATE users SET ' + fields.join(', ') + ' WHERE id = ?', args));