Skip to content

Commit

Permalink
Make it possible to hand OptionsPreset directly to `XmlScriptExecutor…
Browse files Browse the repository at this point in the history
….DoExecute` ignoring the horror show that is `convertPreset`. Other value types will still use `convertPreset`
  • Loading branch information
halgari committed Oct 2, 2024
1 parent bfd8d4d commit 3f6b9f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions InstallScripting/XmlScript/XmlScriptExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ public async override Task<IList<Instruction>> DoExecute(IScript scpScript, stri

m_csmState = new ConditionStateManager();

m_Preset = convertPreset(preset);

if (preset is OptionsPreset preConverted)
m_Preset = preConverted;
else
m_Preset = convertPreset(preset);

if (!(scpScript is XmlScript))
throw new ArgumentException("The given script must be of type XmlScript.", scpScript.Type.TypeName);

Expand Down

0 comments on commit 3f6b9f6

Please sign in to comment.