From 414183e0fd0e365e5f8e891cd6048f4dd1c86262 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 8 Jun 2016 18:04:03 +0530 Subject: [PATCH] fix dereferencing null pointer --- atom/browser/atom_resource_dispatcher_host_delegate.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/atom/browser/atom_resource_dispatcher_host_delegate.cc b/atom/browser/atom_resource_dispatcher_host_delegate.cc index 59ac258ea13..1115aa049d6 100644 --- a/atom/browser/atom_resource_dispatcher_host_delegate.cc +++ b/atom/browser/atom_resource_dispatcher_host_delegate.cc @@ -31,10 +31,13 @@ void HandleExternalProtocolInUI( if (!web_contents) return; - GURL escaped_url(net::EscapeExternalHandlerValue(url.spec())); - auto callback = base::Bind(&OnOpenExternal, escaped_url); auto permission_helper = WebContentsPermissionHelper::FromWebContents(web_contents); + if (!permission_helper) + return; + + GURL escaped_url(net::EscapeExternalHandlerValue(url.spec())); + auto callback = base::Bind(&OnOpenExternal, escaped_url); permission_helper->RequestOpenExternalPermission(callback, has_user_gesture); }