From 05a2481075f5ffdccc094647563d341745add986 Mon Sep 17 00:00:00 2001 From: graemeg Date: Mon, 12 Jan 2009 15:05:46 +0000 Subject: * Revents a possible AV in StringGrid mediator. --- extras/tiopf/gui/tiListMediators.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extras/tiopf/gui/tiListMediators.pas b/extras/tiopf/gui/tiListMediators.pas index f80b18b7..c816a263 100644 --- a/extras/tiopf/gui/tiListMediators.pas +++ b/extras/tiopf/gui/tiListMediators.pas @@ -391,13 +391,17 @@ end; procedure TStringGridMediator.SetSelectedObject(const AValue: TtiObject); var i: integer; + o: TObject; begin for i := 0 to FView.RowCount - 1 do - if TtiObject(FView.Objects[0, i]) = AValue then + begin + o := FView.Objects[0, i]; + if Assigned(o) and (TtiObject(o) = AValue) then begin FView.FocusRow := i; Exit; //==> end; + end; { for } end; procedure TStringGridMediator.SetView(const AValue: TfpgStringGrid); -- cgit v1.2.3-70-g09d2