[commands] Fix RepeatCommand calling end() twice (#5261)

This commit is contained in:
Joseph Eng
2023-04-28 20:57:33 -07:00
committed by GitHub
parent 9cbeb841f5
commit 40ca094686
4 changed files with 82 additions and 44 deletions

View File

@@ -63,7 +63,12 @@ public class RepeatCommand extends CommandBase {
@Override
public void end(boolean interrupted) {
m_command.end(interrupted);
// Make sure we didn't already call end() (which would happen if the command finished in the
// last call to our execute())
if (!m_ended) {
m_command.end(interrupted);
m_ended = true;
}
}
@Override