[gedit] Do not fail when there is no virtual root or root set
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Subject: [gedit] Do not fail when there is no virtual root or root set
- Date: Sat, 25 Apr 2009 06:36:23 -0400 (EDT)
commit 279629369fd14f0d94ed018c19c07323d629bb2f
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat Apr 25 12:36:10 2009 +0200
Do not fail when there is no virtual root or root set
Before, g_return_val_if_fail was used if there was no virtual root/root when requestion get_virtual_root/get_root. This has been changed to simply returning NULL.
---
plugins/filebrowser/gedit-file-browser-store.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index 8c7a08b..55d1149 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -3084,20 +3084,22 @@ gchar *
gedit_file_browser_store_get_root (GeditFileBrowserStore * model)
{
g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL);
- g_return_val_if_fail (model->priv->root != NULL, NULL);
- g_return_val_if_fail (model->priv->root->file != NULL, NULL);
-
- return g_file_get_uri (model->priv->root->file);
+
+ if (model->priv->root == NULL || model->priv->root->file == NULL)
+ return NULL;
+ else
+ return g_file_get_uri (model->priv->root->file);
}
gchar *
gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model)
{
g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL);
- g_return_val_if_fail (model->priv->virtual_root != NULL, NULL);
- g_return_val_if_fail (model->priv->virtual_root->file != NULL, NULL);
- return g_file_get_uri (model->priv->virtual_root->file);
+ if (model->priv->virtual_root == NULL || model->priv->virtual_root->file == NULL)
+ return NULL;
+ else
+ return g_file_get_uri (model->priv->virtual_root->file);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]