pxh.cpp: fix invalid reference if words is empty

This can happen for example if 'line' is a space.
This commit is contained in:
Beat Küng 2019-05-24 11:41:43 +02:00 committed by Daniel Agar
parent 6eb29fca9d
commit f58079bc5d

View File

@ -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()) {