Looks like ObjectBinaryToText doesn't work when Variant property have Null value.
This code fails in Lazarus but work perfectly well in Delphi.
type TTestClass = class(TComponent) private FValue: Variant; public published property Value: Variant read FValue write FValue; end; procedure TForm2.Button1Click(Sender: TObject); var ms: TMemoryStream; ss: TStringStream; tc: TTestClass; begin tc := TTestClass.Create(nil); tc.Value := Null; ms := TMemoryStream.Create; ms.WriteComponent(tc); ms.Position := 0; ss := TStringStream.Create(''); ObjectBinaryToText(ms, ss); Memo1.Text := ss.DataString; ss.Free; ms.Free; tc.Free; end;