[epiphany/mcatanzaro/reader-mode-state] web-view: fix crash in ephy_web_view_get_reader_mode_state




commit b978b292502bf82c547146f33c514594e1fc907d
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed Aug 18 11:48:36 2021 -0500

    web-view: fix crash in ephy_web_view_get_reader_mode_state
    
    Since 2d2d66b8, this can now be called before address is set.
    
    Fixes #1584
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1011>

 embed/ephy-web-view.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index fe1fbf827..22138d986 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -3863,6 +3863,8 @@ ephy_web_view_is_reader_mode_available (EphyWebView *view)
 gboolean
 ephy_web_view_get_reader_mode_state (EphyWebView *view)
 {
+  if (!view->address)
+    return FALSE;
   return g_str_has_prefix (view->address, EPHY_READER_SCHEME);
 }
 


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