Skip to content

Commit 1b2da40

Browse files
committed
Throw error if start segment is greater than end segment.
1 parent fe6666b commit 1b2da40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,10 @@ void AutoStory::run_autostory(SingleSwitchProgramEnvironment& env, ProController
711711
NOTIFICATION_STATUS_UPDATE
712712
};
713713

714+
if (get_start_segment_index() > get_end_segment_index()){
715+
throw UserSetupError(env.logger(), "The start segment cannot be later than the end segment.");
716+
}
717+
714718
for (size_t segment_index = get_start_segment_index(); segment_index <= get_end_segment_index(); segment_index++){
715719
ALL_AUTO_STORY_SEGMENT_LIST()[segment_index]->run_segment(env, context, options);
716720
}

0 commit comments

Comments
 (0)