tvplanit: Fix IDE crashing when a TVpResourceCombo is dropped on a form when there is already a datastore on the form.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8714 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-19 14:15:24 +00:00
parent 3f96acc701
commit 0d61deccb6

View File

@ -1200,9 +1200,12 @@ begin
{ time then connect to the first DataStore component found. }
I := 0;
if (csDesigning in ComponentState) and not (csLoading in ComponentState) then
while (I < Owner.ComponentCount) and (DataStore = nil) do
while (I < Owner.ComponentCount) do
if (Owner.Components[I] is TVpCustomDataStore) then
DataStore := TVpCustomDataStore(Owner.Components[I])
begin
DataStore := TVpCustomDataStore(Owner.Components[I]);
Break;
end
else
Inc(I);
end;