diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index 2c432a0f6a..1af1d82a04 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -3923,7 +3923,7 @@ begin while (j >= 0) and not (SimilarEdit.Plugin[j] is TSynPluginTemplateEdit) do dec(j); end; - if j>=0 then begin + if (SimilarEdit <> nil) and (j >= 0) then begin TSynPluginTemplateEdit(ASynEdit.Plugin[i]).Keystrokes.Assign( TSynPluginTemplateEdit(SimilarEdit.Plugin[j]).KeyStrokes); TSynPluginTemplateEdit(ASynEdit.Plugin[i]).KeystrokesOffCell.Assign(