From 3d12cb2c649fa11404e993e03f5fc64690d084b0 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Fri, 31 May 2013 08:05:14 -0400 Subject: [PATCH] Don't crash when HTML notifications are used on Windows Eventually we'll implement real support for this, but for now not crashing is more important. --- brightray/browser/browser_client.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 72626a5226..a42fcea4cc 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -60,14 +60,20 @@ void BrowserClient::ShowDesktopNotification( int render_process_id, int render_view_id, bool worker) { - notification_presenter()->ShowNotification(params, render_process_id, render_view_id); + auto presenter = notification_presenter(); + if (!presenter) + return; + presenter->ShowNotification(params, render_process_id, render_view_id); } void BrowserClient::CancelDesktopNotification( int render_process_id, int render_view_id, int notification_id) { - notification_presenter()->CancelNotification(render_process_id, render_view_id, notification_id); + auto presenter = notification_presenter(); + if (!presenter) + return; + presenter->CancelNotification(render_process_id, render_view_id, notification_id); } }