diff --git a/src/drivers/distance_sensor/sf0x/sf0x_main.cpp b/src/drivers/distance_sensor/sf0x/sf0x_main.cpp index 0284037d50..0ab7ef9136 100644 --- a/src/drivers/distance_sensor/sf0x/sf0x_main.cpp +++ b/src/drivers/distance_sensor/sf0x/sf0x_main.cpp @@ -48,6 +48,11 @@ static int start(const char *port, uint8_t rotation) return -1; } + if (port == nullptr) { + PX4_ERR("no device specified"); + return -1; + } + /* create the driver */ g_dev = new SF0X(port, rotation);