[gedit] Add two checks to GeditTab



commit 66f87a8c5d0c984acb25b426639758a0679ed1f8
Author: Garrett Regier <alias301 gmail com>
Date:   Thu Jul 1 14:38:55 2010 -0700

    Add two checks to GeditTab

 gedit/gedit-tab.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 1ca5380..076e4d7 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -1705,6 +1705,8 @@ _gedit_tab_new_from_stream (GInputStream        *stream,
 GeditView *
 gedit_tab_get_view (GeditTab *tab)
 {
+	g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL);
+
 	return GEDIT_VIEW (tab->priv->view);
 }
 
@@ -1719,6 +1721,8 @@ gedit_tab_get_view (GeditTab *tab)
 GeditDocument *
 gedit_tab_get_document (GeditTab *tab)
 {
+	g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL);
+
 	return GEDIT_DOCUMENT (gtk_text_view_get_buffer (
 					GTK_TEXT_VIEW (tab->priv->view)));
 }



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