[tepl] Tab: get_buffer(): return NULL if view is NULL
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [tepl] Tab: get_buffer(): return NULL if view is NULL
- Date: Sat, 18 Apr 2020 17:17:45 +0000 (UTC)
commit 25d1dccd302381c8bc53d0f35e83bf07639f5b5f
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Apr 11 17:21:46 2020 +0200
    Tab: get_buffer(): return NULL if view is NULL
    
    If the function is called during TeplTab dispose.
 tepl/tepl-tab.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/tepl/tepl-tab.c b/tepl/tepl-tab.c
index 696677b..9cb7cd1 100644
--- a/tepl/tepl-tab.c
+++ b/tepl/tepl-tab.c
@@ -448,6 +448,11 @@ tepl_tab_get_buffer (TeplTab *tab)
 {
        g_return_val_if_fail (TEPL_IS_TAB (tab), NULL);
 
+       if (tab->priv->view == NULL)
+       {
+               return NULL;
+       }
+
        return TEPL_BUFFER (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]