From 7d9c883abd5c41c36e4dcbbb40f5e9e8f363377c Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 4 Jun 2022 13:34:13 +0200 Subject: [PATCH] shared: LooqsQuery: build(): Return empty query for empty expresion --- shared/looqsquery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/looqsquery.cpp b/shared/looqsquery.cpp index a0790fb..eaf647f 100644 --- a/shared/looqsquery.cpp +++ b/shared/looqsquery.cpp @@ -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");