[nautilus] pathbar: don't unconditionally iterate over buttons when scrolling



commit dac5908d505542362cc51c5c21e0b9220715395a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 21 09:33:23 2011 -0400

    pathbar: don't unconditionally iterate over buttons when scrolling
    
    This should fix https://bugzilla.gnome.org/show_bug.cgi?id=645198

 src/nautilus-pathbar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 3afe8dd..c922565 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -932,7 +932,8 @@ nautilus_path_bar_scroll_down (NautilusPathBar *path_bar)
    	* from the end, removing buttons until we get all the space we
    	* need. */
 	gtk_widget_get_allocation (BUTTON_DATA (up_button->data)->button, &button_allocation);
-        while (space_available < space_needed) {
+        while ((space_available < space_needed) &&
+	       (up_button != NULL)) {
                 space_available += button_allocation.width + path_bar->spacing;
                 up_button = up_button->prev;
                 path_bar->first_scrolled_button = up_button;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]