[tracker/tracker-0.10] tracker-needle: Fix crash in result store
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] tracker-needle: Fix crash in result store
- Date: Fri, 21 Oct 2011 14:25:46 +0000 (UTC)
commit ac653162cbbf982427d22c7794e80038fe173366
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 506f08b..f98a8f7 100644
--- a/src/tracker-needle/tracker-result-store.vala
+++ b/src/tracker-needle/tracker-result-store.vala
@@ -660,8 +660,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]