fix(modes): don't attempt to retrieve a stage index if HPs are an array (#4542)
This commit is contained in:
parent
900a265637
commit
44648eef92
@ -218,11 +218,11 @@ export default function ModeRoute({
|
|||||||
: hangingProtocol;
|
: hangingProtocol;
|
||||||
|
|
||||||
// Determine the index of the stageId if the hangingProtocolIdToUse is defined
|
// Determine the index of the stageId if the hangingProtocolIdToUse is defined
|
||||||
const stageIndex = hangingProtocolIdToUse
|
const stageIndex = Array.isArray(hangingProtocolIdToUse)
|
||||||
? hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
|
? -1
|
||||||
|
: hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
|
||||||
stageId: runTimeStageId || undefined,
|
stageId: runTimeStageId || undefined,
|
||||||
})
|
});
|
||||||
: -1;
|
|
||||||
// Ensure that the stage index is never negative
|
// Ensure that the stage index is never negative
|
||||||
// If stageIndex is negative (e.g., if stage wasn't found), use 0 as the default
|
// If stageIndex is negative (e.g., if stage wasn't found), use 0 as the default
|
||||||
const stageIndexToUse = Math.max(0, stageIndex);
|
const stageIndexToUse = Math.max(0, stageIndex);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user