IDE: Sanity check when loading LPS run modes. Issue #35410, patch from Ondrej.

git-svn-id: trunk@61051 -
This commit is contained in:
juha 2019-04-24 19:16:47 +00:00
parent 0b48576ddd
commit 0a6a5d2b43

View File

@ -366,7 +366,7 @@ function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string;
var
Cnt, I: Integer;
NewMode: TRunParamsOptionsMode;
ModePath: string;
ModePath, NewActiveModeName: string;
begin
//don't clear! needed for merging lpi and lps
@ -385,7 +385,11 @@ begin
if ASaveIn=rpsLPS then
begin
ActiveModeName := XMLConfig.GetValue(Path + 'Modes/ActiveMode', '');
NewActiveModeName := XMLConfig.GetValue(Path + 'Modes/ActiveMode', '');
// sanity check -> modes from LPI could be modified independently on LPS and
// NewActiveModeName doesn't have to exist any more
if Assigned(Find(NewActiveModeName)) then
ActiveModeName := NewActiveModeName;
if (GetActiveMode=nil) and (Count>0) then
ActiveModeName := Modes[0].Name;
end;