[commands] Delete UB-causing rvalue variants of CommandPtr methods (#4923)

Co-authored-by: Ryan Blue <ryanzblue@gmail.com>
This commit is contained in:
Starlight220
2023-01-12 08:53:04 +02:00
committed by GitHub
parent 34519de60a
commit befd12911c
3 changed files with 34 additions and 15 deletions

View File

@@ -433,9 +433,10 @@ void CommandScheduler::OnCommandFinish(Action action) {
void CommandScheduler::RequireUngrouped(const Command* command) {
if (command->IsComposed()) {
throw FRC_MakeError(
frc::err::CommandIllegalUse,
"Commands cannot be added to more than one CommandGroup");
throw FRC_MakeError(frc::err::CommandIllegalUse,
"Commands that have been composed may not be added to "
"another composition or scheduled "
"individually!");
}
}