From 07f57c216e01d511d2b3c047eb9612494956cbd0 Mon Sep 17 00:00:00 2001 From: Tomoya Kimura Date: Fri, 1 Dec 2023 09:36:28 +0900 Subject: [PATCH] fix(system_error_monitor): avoid invalid access to nullptr (#5729) Signed-off-by: tomoya.kimura --- system/system_error_monitor/src/system_error_monitor_core.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/system_error_monitor/src/system_error_monitor_core.cpp b/system/system_error_monitor/src/system_error_monitor_core.cpp index c7fdfa61f1d2c..fb0a607b9825a 100644 --- a/system/system_error_monitor/src/system_error_monitor_core.cpp +++ b/system/system_error_monitor/src/system_error_monitor_core.cpp @@ -702,7 +702,9 @@ bool AutowareErrorMonitor::onClearEmergencyService( void AutowareErrorMonitor::loggingErrors( const autoware_auto_system_msgs::msg::HazardStatus & hazard_status) { - if (isInNoFaultCondition(*autoware_state_, *current_gate_mode_)) { + if ( + autoware_state_ && current_gate_mode_ && + isInNoFaultCondition(*autoware_state_, *current_gate_mode_)) { RCLCPP_DEBUG(get_logger(), "Autoware is in no-fault condition."); return; }