diff options
author | William Jon McCann <jmccann@redhat.com> | 2012-09-04 20:21:55 -0400 |
---|---|---|
committer | William Jon McCann <jmccann@redhat.com> | 2012-09-05 14:34:40 -0400 |
commit | 185dad3c3ace1e6f11897b5e7c11d083a378785b (patch) | |
tree | 696e904d3af326a67bf24fadaf9df5118dfd74cd | |
parent | 3416a818372aab6ad81c8b7ee3467802bc04c028 (diff) | |
download | nautilus-185dad3c3ace1e6f11897b5e7c11d083a378785b.tar.gz |
Don't crash if we can't load column preferences
https://bugzilla.gnome.org/show_bug.cgi?id=662131
-rw-r--r-- | libnautilus-private/nautilus-column-utilities.c | 6 | ||||
-rw-r--r-- | src/nautilus-list-view.c | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/libnautilus-private/nautilus-column-utilities.c b/libnautilus-private/nautilus-column-utilities.c index d328ab1f3..ea8aad27c 100644 --- a/libnautilus-private/nautilus-column-utilities.c +++ b/libnautilus-private/nautilus-column-utilities.c @@ -337,12 +337,12 @@ GList * nautilus_sort_columns (GList *columns, char **column_order) { - if (!column_order) { - return NULL; + if (column_order == NULL) { + return columns; } return g_list_sort_with_data (columns, (GCompareDataFunc)column_compare, column_order); } - + diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index 25fd2e58e..e1d8e34ff 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c @@ -1249,10 +1249,12 @@ apply_columns_settings (NautilusListView *list_view, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_free); - for (i = 0; visible_columns[i] != NULL; ++i) { - g_hash_table_insert (visible_columns_hash, - g_ascii_strdown (visible_columns[i], -1), - g_ascii_strdown (visible_columns[i], -1)); + if (visible_columns != NULL) { + for (i = 0; visible_columns[i] != NULL; ++i) { + g_hash_table_insert (visible_columns_hash, + g_ascii_strdown (visible_columns[i], -1), + g_ascii_strdown (visible_columns[i], -1)); + } } for (l = all_columns; l != NULL; l = l->next) { |