shared: LooqsQuery: build(): Return empty query for empty expresion

This commit is contained in:
Albert S. 2022-06-04 13:34:13 +02:00
parent 49e408be50
commit 7d9c883abd

View File

@ -169,6 +169,10 @@ void LooqsQuery::addToken(Token t)
* TODO: It's a bit ugly still*/
LooqsQuery LooqsQuery::build(QString expression, TokenType loneWordsTokenType, bool mergeLoneWords)
{
if(expression.isEmpty())
{
return LooqsQuery{};
}
if(!checkParanthesis(expression))
{
throw LooqsGeneralException("Invalid paranthesis");