Commit 846a541f authored by Carlos Garnacho's avatar Carlos Garnacho

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>
parent 0ca3ebf3
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment