[nautilus] Fix segfault when result list is empty
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Fix segfault when result list is empty
- Date: Thu, 9 Aug 2012 10:45:17 +0000 (UTC)
commit 1d505a3ab7bc9d59713b90fc78e910842b7e7754
Author: Florian MÃllner <fmuellner gnome org>
Date: Wed Aug 8 22:25:00 2012 +0200
Fix segfault when result list is empty
Commit 50711e28b introduced selecting the first result automatically,
but didn't handle the case where the result list is empty.
https://bugzilla.gnome.org/show_bug.cgi?id=681479
libnautilus-private/nautilus-canvas-container.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 1718379..8596f87 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -6795,7 +6795,9 @@ nautilus_canvas_container_select_first (NautilusCanvasContainer *container)
selection_changed = FALSE;
icon = g_list_nth_data (container->details->icons, 0);
- selection_changed |= icon_set_selected (container, icon, TRUE);
+ if (icon) {
+ selection_changed |= icon_set_selected (container, icon, TRUE);
+ }
if (selection_changed) {
g_signal_emit (container,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]