diff --git a/converter/convertdelphi.pas b/converter/convertdelphi.pas index 869965f933..01ebf40dd3 100644 --- a/converter/convertdelphi.pas +++ b/converter/convertdelphi.pas @@ -724,12 +724,8 @@ begin ExtractFileName(fLazUnitFilename), fOwnerConverter.fSettings.SupportDelphi); case Result of // mrOK means: Comment out. - mrOK: begin - if fOwnerConverter is TConvertDelphiProjPack then - MoveMissingToComment(fOwnerConverter.fAllCommentedUnits) - else - MoveMissingToComment(Nil); - end; + mrOK: + MoveMissingToComment(fOwnerConverter.fAllCommentedUnits); // mrYes means: Search for unit path. mrYes: begin UnitDirDialog:=TSelectDirectoryDialog.Create(nil); diff --git a/converter/usedunits.pas b/converter/usedunits.pas index ee63142999..122370231d 100644 --- a/converter/usedunits.pas +++ b/converter/usedunits.pas @@ -463,8 +463,9 @@ procedure TUsedUnits.CommentAutomatic(ACommentedUnits: TStringList); var i, x: Integer; begin + if ACommentedUnits = Nil then Exit; for i:=fMissingUnits.Count-1 downto 0 do begin - if Assigned(ACommentedUnits) and ACommentedUnits.Find(fMissingUnits[i], x) then + if ACommentedUnits.Find(fMissingUnits[i], x) then begin fUnitsToComment.Add(fMissingUnits[i]); fMissingUnits.Delete(i);