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