From f633ef1a7f521818591848ac78ba8d0d8b307cdf Mon Sep 17 00:00:00 2001 From: Daniel Prado Velasco Date: Sun, 17 Mar 2024 16:02:38 +0100 Subject: [PATCH] Fix error related with "New: Returning to a node now retrieves the exact position in the editor, including status bar scrolling" (Commit dd194bc25b993) --- structure/kn_TreeNoteMng.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/structure/kn_TreeNoteMng.pas b/structure/kn_TreeNoteMng.pas index a13f7e8..b4ad3a0 100644 --- a/structure/kn_TreeNoteMng.pas +++ b/structure/kn_TreeNoteMng.pas @@ -415,7 +415,8 @@ procedure TreeNodeSelected( Node : TTreeNTNode; OnDeletingNode: boolean= false ) myTreeNote := TTreeNote( ActiveNote ); KeepModified:= false; - myTreeNote.SelectedNode.ScrollPosInEditor:= ActiveNote.Editor.GetScrollPosInEditor; + if assigned(myTreeNote.SelectedNode) then + myTreeNote.SelectedNode.ScrollPosInEditor:= ActiveNote.Editor.GetScrollPosInEditor; if ( not _Executing_History_Jump ) and (not _Executing_JumpToKNTLocation_ToOtherNote) then begin AddHistoryLocation( myTreeNote, false); // Add to history the location of current node, before the new node comes to be the selected node