From 647e718cb2c2873312ecabdf43a7dccafd9bcfa1 Mon Sep 17 00:00:00 2001 From: muramura Date: Wed, 17 Jul 2024 07:20:26 +0900 Subject: [PATCH] AP_HAL_SITL: Set NULLPTR if the preprocessor is undefined --- libraries/AP_HAL_SITL/CANSocketIface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_HAL_SITL/CANSocketIface.cpp b/libraries/AP_HAL_SITL/CANSocketIface.cpp index e64253b79bc884..07e9e84ebbcf0b 100644 --- a/libraries/AP_HAL_SITL/CANSocketIface.cpp +++ b/libraries/AP_HAL_SITL/CANSocketIface.cpp @@ -222,6 +222,8 @@ bool CANIface::init(const uint32_t bitrate, const OperatingMode mode) case SITL::SIM::CANTransport::SocketCAN: #if HAL_CAN_WITH_SOCKETCAN transport = NEW_NOTHROW CAN_SocketCAN(); +#else + transport = nullptr; #endif break; case SITL::SIM::CANTransport::None: