diff --git a/examples/cpp/configuration/CLIParser.hpp b/examples/cpp/configuration/CLIParser.hpp index 676e20ae090..6d66d718e1b 100644 --- a/examples/cpp/configuration/CLIParser.hpp +++ b/examples/cpp/configuration/CLIParser.hpp @@ -228,6 +228,12 @@ class CLIParser { configuration_config config; + if (argc < 2) + { + EPROSIMA_LOG_ERROR(CLI_PARSER, "missing entity argument"); + print_help(EXIT_FAILURE); + } + std::string first_argument = argv[1]; if (first_argument == "publisher" )