Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: Source/modules/vibration/NavigatorVibration.cpp

Issue 298683002: navigator.vibrate() crash avoidance when in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rephrase null check Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/vibration/vibration-detached-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/vibration/NavigatorVibration.cpp
diff --git a/Source/modules/vibration/NavigatorVibration.cpp b/Source/modules/vibration/NavigatorVibration.cpp
index c4a16ffbd122ea0065c500d8efac0e779dbe0cd3..6a8b5d31b8c281911606cc162c9b7cf7b0e90914 100644
--- a/Source/modules/vibration/NavigatorVibration.cpp
+++ b/Source/modules/vibration/NavigatorVibration.cpp
@@ -145,6 +145,9 @@ bool NavigatorVibration::vibrate(Navigator& navigator, unsigned time)
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
+ if (!navigator.frame())
+ return false;
+
Page* page = navigator.frame()->page();
if (!page)
return false;
« no previous file with comments | « LayoutTests/vibration/vibration-detached-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698