Bug 356206

Summary: baloo will assert when searchString is empty.
Product: [Unmaintained] Baloo Reporter: Weng Xuetian <wengxt>
Component: GeneralAssignee: Vishesh Handa <me>
Status: RESOLVED FIXED    
Severity: normal CC: pinak.ahuja
Priority: NOR    
Version First Reported In: 5.9.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Weng Xuetian 2015-12-02 18:24:33 UTC
When search string is empty, query.d->m_term.value() will be invalid, which is actually a valid case.

Reproducible: Always

Steps to Reproduce:
1. build baloo with debug
2. run baloosearch ""
3. assertion happens.
ASSERT: "term.value().isValid()" in file src/lib/searchstore.cpp, line 178

Actual Results:  
assertion happens

Expected Results:  
no assertion happens
Comment 1 Vishesh Handa 2015-12-14 23:04:24 UTC
Confirmed. Good catch.
Comment 2 Vishesh Handa 2015-12-14 23:15:19 UTC
* commit 9b17d81b5152d28eba80b4b67fbda2ca5da41054
| Author: Vishesh Handa <me@vhanda.in>
| Date:   Tue Dec 15 00:09:16 2015 +0100
|
|     SearchStore: Gracefully handle empty term values
|
|     This happens on calling the baloosearch executable with an empty string
|     or a few spaces.
|
|     BUG: 356176
|     FIXED-IN: 5.18