aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-05-14 22:00:09 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-05-14 22:00:09 +0800
commit310189326247ec07951b30c52abc69050be5d2b9 (patch)
tree13cb469834f605b585ac0d2286c5848670db3be1 /shell
parent6ed6cd5bf316e07b1f3f698f38b8cde748031f22 (diff)
downloadgsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.gz
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.bz2
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.lz
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.xz
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.zst
gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.zip
Protect against unknown folder types better.
svn path=/trunk/; revision=3025
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-folder-type-repository.c15
2 files changed, 22 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 4f0924778d..e692ac0cf3 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,12 @@
2000-05-14 Ettore Perazzoli <ettore@helixcode.com>
+ * e-folder-type-repository.c
+ (e_folder_type_repository_get_control_id_for_type): Protect
+ against non-existing types.
+ (e_folder_type_repository_get_icon_for_type): Likewise.
+
+2000-05-14 Ettore Perazzoli <ettore@helixcode.com>
+
* e-storage-set-view.c
(folder_compare_cb): Callback comparison function for comparing
folders based on their names.
diff --git a/shell/e-folder-type-repository.c b/shell/e-folder-type-repository.c
index d53c0d95d7..c96ab5a5b6 100644
--- a/shell/e-folder-type-repository.c
+++ b/shell/e-folder-type-repository.c
@@ -231,6 +231,11 @@ e_folder_type_repository_get_icon_name_for_type (EFolderTypeRepository *folder_t
g_return_val_if_fail (type_name != NULL, NULL);
folder_type = get_folder_type (folder_type_repository, type_name);
+ if (folder_type == NULL) {
+ g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name);
+ return NULL;
+ }
+
return folder_type->icon_name;
}
@@ -245,6 +250,11 @@ e_folder_type_repository_get_icon_for_type (EFolderTypeRepository *folder_type_r
g_return_val_if_fail (type_name != NULL, NULL);
folder_type = get_folder_type (folder_type_repository, type_name);
+ if (folder_type == NULL) {
+ g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name);
+ return NULL;
+ }
+
return folder_type->icon_pixbuf;
}
@@ -259,6 +269,11 @@ e_folder_type_repository_get_control_id_for_type (EFolderTypeRepository *folder_
g_return_val_if_fail (type_name != NULL, NULL);
folder_type = get_folder_type (folder_type_repository, type_name);
+ if (folder_type == NULL) {
+ g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name);
+ return NULL;
+ }
+
return folder_type->control_id;
}