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.
This commit is contained in:
Adam Roben 2013-05-31 08:05:14 -04:00
parent 2582e8561c
commit 3d12cb2c64

View file

@ -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);
}
}