From 38efae317305b4a511053d82cb7e4b0e65b19fc1 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Mon, 3 Jul 2023 09:25:37 +0200 Subject: [PATCH] Fix: Fix creating a new user with added check When determining whether to show the superuser confirmation in the user dialog, also check if there is a user being edited. Without this check, attempting to create a new user would cause an error when saving. --- src/web/pages/users/dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/web/pages/users/dialog.js b/src/web/pages/users/dialog.js index 2e2d7ff08b..ddfc8f79f6 100644 --- a/src/web/pages/users/dialog.js +++ b/src/web/pages/users/dialog.js @@ -118,7 +118,10 @@ class Dialog extends React.Component { * or you have already confirmed that you want to save the user data * without any role. */ - if (this.props.username === this.props.user.name) { + if ( + isDefined(this.props.user) && + this.props.username === this.props.user.name + ) { /* * You reach this point only as a Super Admin, when you try to save your * own personal user data. The confirmation dialog opens. The data can