IDE: Remove an assertion in TMessagesCtrl. Triggered rarely by timing issues. Issue #39503.

(cherry picked from commit 4020cb96fb)
This commit is contained in:
Juha 2021-12-08 12:20:17 +02:00 committed by Maxim Ganetsky
parent cc734c628b
commit b86b163829

View File

@ -1251,15 +1251,10 @@ end;
procedure TMessagesCtrl.SetSelectedLine(AValue: integer);
// Select the given line, clear possibly existing selections.
var
LineCnt: Integer;
begin
Assert(AValue>=-1, 'TMessagesCtrl.SetSelectedLine: AValue < -1.');
Assert(Assigned(SelectedView), 'TMessagesCtrl.SetSelectedLine: View = Nil.');
LineCnt:=SelectedView.GetShownLineCount(false,true)-1;
Assert(AValue<=LineCnt, 'TMessagesCtrl.SetSelectedLine: Value '+IntToStr(AValue)
+ ' > line count ' + IntToStr(LineCnt));
//AValue:=Min(AValue, SelectedView.GetShownLineCount(false,true)-1);
AValue:=Min(AValue, SelectedView.GetShownLineCount(false,true)-1);
if (FSelectedLines.Count>0) and (FSelectedLines[0]=AValue) then
Exit;
FSelectedLines.Count:=1; // One line.