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

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: 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..ed0d441c28787d3974167cd670b88a4b0fc5062b 100644
--- a/Source/modules/vibration/NavigatorVibration.cpp
+++ b/Source/modules/vibration/NavigatorVibration.cpp
@@ -145,7 +145,7 @@ bool NavigatorVibration::vibrate(Navigator& navigator, unsigned time)
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
- Page* page = navigator.frame()->page();
+ Page* page = navigator.frame() ? navigator.frame()->page() : 0;
haraken 2014/05/20 10:56:48 Or you can write: if (!navigator.frame()) retur
sof 2014/05/20 12:42:46 Done.
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