mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-22 10:27:22 +02:00
LCL/ShellCtrls: Do not raise a silent exception when the current path in the TreeView does not exist any more.
This commit is contained in:
parent
01d11f00ee
commit
222117e473
@ -652,12 +652,8 @@ begin
|
|||||||
RootNode := Items.AddChild(nil, FRoot);
|
RootNode := Items.AddChild(nil, FRoot);
|
||||||
RootNode.HasChildren := True;
|
RootNode.HasChildren := True;
|
||||||
RootNode.Expand(False);
|
RootNode.Expand(False);
|
||||||
try
|
if Exists(CurrPath) then
|
||||||
SetPath(CurrPath);
|
SetPath(CurrPath);
|
||||||
except
|
|
||||||
// CurrPath may have been removed in the mean time by another process, just ignore
|
|
||||||
on E: EInvalidPath do ;//
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
@ -675,12 +671,8 @@ begin
|
|||||||
try
|
try
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
Refresh(nil);
|
Refresh(nil);
|
||||||
try
|
if Exists(CurrPath) then
|
||||||
SetPath(CurrPath);
|
SetPath(CurrPath);
|
||||||
except
|
|
||||||
// CurrPath may have been removed in the mean time by another process, just ignore
|
|
||||||
on E: EInvalidPath do ;//
|
|
||||||
end;
|
|
||||||
finally
|
finally
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
@ -710,12 +702,8 @@ begin
|
|||||||
RootNode := Items.AddChild(nil, FRoot);
|
RootNode := Items.AddChild(nil, FRoot);
|
||||||
RootNode.HasChildren := True;
|
RootNode.HasChildren := True;
|
||||||
RootNode.Expand(False);
|
RootNode.Expand(False);
|
||||||
try
|
if Exists(Currpath) then
|
||||||
SetPath(CurrPath);
|
SetPath(CurrPath);
|
||||||
except
|
|
||||||
// CurrPath may have been removed in the mean time by another process, just ignore
|
|
||||||
on E: EInvalidPath do ;//
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
|
Loading…
Reference in New Issue
Block a user