[geary] Fix critical warning when conversation web view load request URI is null.



commit 9c31401606696f3df17e04c7d1d502cf9c85e8cf
Author: Michael James Gratton <mike vee net>
Date:   Thu Aug 4 10:51:15 2016 +1000

    Fix critical warning when conversation web view load request URI is null.
    
    * src/client/conversation-viewer/conversation-web-view.vala
      (ConversationWebView::on_resource_request_starting): Check that the URI
      is not null before using it.
      (ConversationWebView::is_always_loaded): Remove null check and don't
      allow the param to be null, since all uses now pass in a non-null
      param.

 .../conversation-viewer/conversation-web-view.vala |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-web-view.vala 
b/src/client/conversation-viewer/conversation-web-view.vala
index 57dcbd0..b6c9cda 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -99,18 +99,15 @@ public class ConversationWebView : StylishWebView {
         }
 
         string? uri = request.get_uri();
-        if (!is_always_loaded(uri)) {
+        if (uri != null && !is_always_loaded(uri)) {
             if (uri.has_prefix(allow_prefix))
                 request.set_uri(uri.substring(allow_prefix.length));
             else
                 request.set_uri("about:blank");
         }
     }
-    
-    public bool is_always_loaded(string? uri) {
-        if (uri == null)
-            return true;
-        
+
+    public bool is_always_loaded(string uri) {
         foreach (string prefix in always_loaded_prefixes) {
             if (uri.has_prefix(prefix))
                 return true;


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