Skip to content

Commit

Permalink
Fix: Fix creating a new user with added check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
timopollmeier authored and bjoernricks committed Jul 3, 2023
1 parent 6e70614 commit 38efae3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/web/pages/users/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38efae3

Please sign in to comment.