mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-24 16:01:53 +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:
1 parent
6eb29fca9d
commit
f58079bc5d
1 file changed
+4
@@ -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