From 0e3374dc1b9e07a537e6a0796785e54c7979a582 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Mon, 4 Nov 2024 19:51:59 -0800 Subject: [PATCH] settings_users: Don't use `text()` with undefined value. `text(undefined)` is a noop, and also isn't validly typed. --- web/src/settings_users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/settings_users.js b/web/src/settings_users.js index 05fc0bee6c..5e0f87cd0c 100644 --- a/web/src/settings_users.js +++ b/web/src/settings_users.js @@ -440,7 +440,10 @@ export function update_user_data(user_id, new_data) { } if (new_data.role !== undefined) { - $user_row.find(".user_role").text(people.get_user_type(user_id)); + const user_type = people.get_user_type(user_id); + if (user_type) { + $user_row.find(".user_role").text(user_type); + } } }