diff --git a/src/drivers/pps_capture/PPSCapture.cpp b/src/drivers/pps_capture/PPSCapture.cpp index 3efea51f86..5d75c7ef40 100644 --- a/src/drivers/pps_capture/PPSCapture.cpp +++ b/src/drivers/pps_capture/PPSCapture.cpp @@ -213,7 +213,7 @@ void PPSCapture::stop() extern "C" __EXPORT int pps_capture_main(int argc, char *argv[]) { - if (!strcmp(argv[1], "stop")) { + if (argc >= 2 && !strcmp(argv[1], "stop") && PPSCapture::is_running()) { PPSCapture::stop(); }