diff options
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/e-folder-type-repository.c | 15 |
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; } |