mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] C++ CommandPtr: Prevent null initialization (#5991)
This commit is contained in:
@@ -22,6 +22,11 @@
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
CommandPtr::CommandPtr(std::unique_ptr<Command>&& command)
|
||||
: m_ptr(std::move(command)) {
|
||||
AssertValid();
|
||||
}
|
||||
|
||||
void CommandPtr::AssertValid() const {
|
||||
if (!m_ptr) {
|
||||
throw FRC_MakeError(frc::err::CommandIllegalUse,
|
||||
|
||||
Reference in New Issue
Block a user