Fix sporadic crash in Tconnform.TimerStatisticsTimer due to empty session path

This commit is contained in:
Ansgar Becker
2020-12-15 07:21:15 +01:00
parent 1733156502
commit 1f82efa02c

View File

@@ -633,8 +633,12 @@ function Tconnform.SelectedSessionPath: String;
var
Sess: PConnectionParameters;
begin
Sess := ListSessions.GetNodeData(ListSessions.FocusedNode);
Result := Sess.SessionPath;
if not Assigned(ListSessions.FocusedNode) then
Result := ''
else begin
Sess := ListSessions.GetNodeData(ListSessions.FocusedNode);
Result := Sess.SessionPath;
end;
end;
@@ -1010,6 +1014,9 @@ begin
Exit;
AppSettings.SessionPath := SelectedSessionPath;
if AppSettings.SessionPath.IsEmpty then
Exit;
DummyDate := StrToDateTime('2000-01-01');
LastConnect := StrToDateTimeDef(AppSettings.ReadString(asLastConnect), DummyDate);
if LastConnect <> DummyDate then begin