diff --git a/helpcompiler/source/HelpSearch.cxx b/helpcompiler/source/HelpSearch.cxx index 982e672c4573..8e6e8d9ecadf 100644 --- a/helpcompiler/source/HelpSearch.cxx +++ b/helpcompiler/source/HelpSearch.cxx @@ -29,7 +29,7 @@ void HelpSearch::query(OUString const &queryStr, bool captionOnly, const TCHAR* field = captionOnly ? L"caption" : L"content"; - bool isWildcard = queryStr[queryStr.getLength() - 1] == L'*'; + const bool isWildcard = (!queryStr.isEmpty() && queryStr[queryStr.getLength() - 1] == L'*'); std::vector aQueryStr(OUStringToTCHARVec(queryStr)); lucene::search::Query *pQuery; if (isWildcard)