mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-08-21 16:50:34 +08:00
pxh.cpp: fix invalid reference if words is empty
This can happen for example if 'line' is a space.
This commit is contained in:
@@ -84,6 +84,10 @@ int Pxh::process_line(const std::string &line, bool silently_fail)
|
||||
words.push_back(word);
|
||||
}
|
||||
|
||||
if (words.empty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::string &command(words.front());
|
||||
|
||||
if (_apps.find(command) != _apps.end()) {
|
||||
|
||||
Reference in New Issue
Block a user