IdeDebugger: fix crash in watches window. Issue #41530 / Disable "Format watch" if no watch selected.

(cherry picked from commit 3d0e837d14)
This commit is contained in:
Martin 2025-03-15 09:41:19 +01:00
parent 4186441ba3
commit fd2daa7db3

View File

@ -590,6 +590,8 @@ begin
actPower.Enabled := True;
actToggleInspectSite.Enabled := True;
popupWatchFormatPresets.Enabled := HasTopWatchSelected or
( (Watch<>nil) and (Watch = Watch.TopParentWatch));
UpdateInspectPane;
end;
@ -1095,7 +1097,7 @@ begin
end
else begin
Watch := TIdeWatch(GetSelected);
if (Watch.TopParentWatch = Watch) then begin
if (Watch <> nil) and (Watch.TopParentWatch = Watch) then begin
d := APreset.DisplayFormat;
d.CopyInheritedFrom(Watch.DisplayFormat);
Watch.DisplayFormat := d;
@ -1316,7 +1318,7 @@ begin
end
else begin
Watch := TCurrentWatch(GetSelected);
if (Watch.TopParentWatch = Watch) then begin
if (Watch <> nil) and (Watch.TopParentWatch = Watch) then begin
d := Watch.Values[GetThreadId, GetStackframe];
dk := rdkUnknown;
if (d <> nil) and (d.Validity = ddsValid) and (d.ResultData <> nil) then