don't segfault when running fridge actions without a fridge
Change-Id: I27a18cd8a0385160115db15093e9970460aa6b1b
diff --git a/frc971/actors/fridge_profile_lib.h b/frc971/actors/fridge_profile_lib.h
index 0ba4bcf..747f635 100644
--- a/frc971/actors/fridge_profile_lib.h
+++ b/frc971/actors/fridge_profile_lib.h
@@ -65,6 +65,11 @@
bool front_grabbers, bool back_grabbers) {
if (this->ShouldCancel()) {
LOG(INFO, "Canceling fridge movement\n");
+ if (!control_loops::fridge_queue.status.get()) {
+ LOG(WARNING, "no fridge status so can't really cancel\n");
+ return CANCELED;
+ }
+
auto new_fridge_goal = control_loops::fridge_queue.goal.MakeMessage();
new_fridge_goal->profiling_type = 0;
new_fridge_goal->max_velocity = elevator_parameters.velocity;