diff --git a/components/jcf2/ReadWrite/EditorConverter.pas b/components/jcf2/ReadWrite/EditorConverter.pas index 0164bbc690..dae95a3dc1 100644 --- a/components/jcf2/ReadWrite/EditorConverter.pas +++ b/components/jcf2/ReadWrite/EditorConverter.pas @@ -131,14 +131,11 @@ begin GetRegSettings.ReadAll; { check for read-only } - if pciUnit <> nil then + if pciUnit.ReadOnly then begin - if pciUnit.ReadOnly then - begin - SendStatusMessage(pciUnit.FileName, 'Unit is read only. Cannot format ', - mtInputError, -1, -1); - exit; - end; + SendStatusMessage(pciUnit.FileName, 'Unit is read only. Cannot format ', + mtInputError, -1, -1); + exit; end; fsCurrentUnitName := pciUnit.FileName;