[tracker/tracker-0.12] tracker-needle: Fix crash in result store
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.12] tracker-needle: Fix crash in result store
- Date: Thu, 20 Oct 2011 12:46:00 +0000 (UTC)
commit 7617741fed1bbc87e6423ddda04087525eafc82f
Author: Carlos Garnacho <carlos lanedo com>
Date: Tue Oct 18 14:32:55 2011 +0200
tracker-needle: Fix crash in result store
n_children() would crash if there weren't any items
in the categories array. Fixes GB#661446, reported by
Damien Gombault <desintegr gmail com>
src/tracker-needle/tracker-result-store.vala | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-needle/tracker-result-store.vala b/src/tracker-needle/tracker-result-store.vala
index 4e5f22a..e3a11f6 100644
--- a/src/tracker-needle/tracker-result-store.vala
+++ b/src/tracker-needle/tracker-result-store.vala
@@ -690,8 +690,10 @@ public class Tracker.ResultStore : Gtk.TreeModel, GLib.Object {
if (iter == null) {
if (queries.length > 1) {
return categories.length - 1;
- } else {
+ } else if (categories.length > 0) {
return categories[0].count;
+ } else {
+ return -1;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]