[geary/geary-0.11] Fix critical warning when conversation web view load request URI is null.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/geary-0.11] Fix critical warning when conversation web view load request URI is null.
- Date: Sun, 14 Aug 2016 07:44:53 +0000 (UTC)
commit a36d74722e3fee8b561303ff39e986780e4fe3e7
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 50ed18c..32f1fd4 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]