Skip to content

Commit

Permalink
WB_FormulaSwitchToStimset: Avoid endless loop
Browse files Browse the repository at this point in the history
When we don't have any stimsets the for-loop would never finish.
  • Loading branch information
t-b committed Sep 29, 2023
1 parent 1033e35 commit de23b63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_WaveBuilder.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ Function WB_FormulaSwitchToStimset(variable channelType, string formula, STRUCT
// iterate the stimset list from bottom to top, so that we replace first the shorthands
// with numeric prefix and only later on the ones without
numSets = DimSize(epochCombineList, ROWS)
for(i = numSets - 1; i >= 0; i -= 1)
for(i = numSets - 1; i >= 0 && numSets > 0; i -= 1)
shorthand = epochCombineList[i][%Shorthand]
stimset = epochCombineList[i][%stimset]
stimsetSpec = LowerStr(stimset) + "?"
Expand Down

0 comments on commit de23b63

Please sign in to comment.