mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +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:
parent
6eb29fca9d
commit
f58079bc5d
@ -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()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user