Skip to content

Commit

Permalink
Fix unwanted enabling FModified flag in user manager dialog, when jus…
Browse files Browse the repository at this point in the history
…t switching the main tab to "Limitations", followed by a crash due to no focused user. Closes #493.
  • Loading branch information
ansgarbecker committed May 26, 2019
1 parent 493138d commit 8f9abb2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/usermanager.pas
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,19 @@ procedure TUserManagerForm.Modification(Sender: TObject);
var
User: PUser;
begin
if Assigned(listUsers.FocusedNode) and (TWinControl(Sender).Parent = tabLimitations) then begin
if not Assigned(listUsers.FocusedNode) then
Exit;
if TWinControl(Sender).Parent = tabLimitations then begin
// Any TUpDown triggers a OnChange event on its TEdit when the UpDown gets painted
User := listUsers.GetNodeData(listUsers.FocusedNode);
Modified := Modified
or (editMaxQueries.Text <> IntToStr(User.MaxQueries))
or (editMaxUpdates.Text <> IntToStr(User.MaxUpdates))
or (editMaxConnections.Text <> IntToStr(User.MaxConnections))
or (editMaxUserConnections.Text <> IntToStr(User.MaxUserConnections));
end else
end else begin
Modified := True;
end;
end;


Expand Down

0 comments on commit 8f9abb2

Please sign in to comment.