Skip to content
Permalink
Browse files

Fix crash when trying to add a new grid row while a first one was not…

… yet saved. Closes #788
  • Loading branch information...
ansgarbecker committed Nov 1, 2019
1 parent 83e0602 commit b2ecff52106c3be6789925dc6b67950ea575fdc1
Showing with 6 additions and 2 deletions.
  1. +6 −2 source/main.pas
@@ -9401,8 +9401,12 @@ procedure TMainForm.AnyGridFocusChanging(Sender: TBaseVirtualTree; OldNode,
Allowed := Results.SaveModifications;
DisplayRowCountStats(Sender);
end else if Results.Inserted then begin
Results.DiscardModifications;
Sender.DeleteNode(OldNode);
if NewNode <> nil then begin
Results.DiscardModifications;
Sender.DeleteNode(OldNode);
end else begin
Allowed := False;
end;
end;
end;
end;

0 comments on commit b2ecff5

Please sign in to comment.
You can’t perform that action at this time.