Why is this an issue?

System.Assigned is more flexible and has less edge cases than a normal nil comparison. In particular:

How to fix it

Replace the nil comparison with a call to Assigned:

procedure LogAssigned(MyObj: TObject);
begin
  if MyObj <> nil then begin
    Writeln('Object is assigned');
  end;
end;
procedure LogAssigned(MyObj: TObject);
begin
  if Assigned(MyObj) then begin
    Writeln('Object is assigned');
  end;
end;

Resources