Bug 927586 - [@ nsDOMWindowUtils::GetIsTestControllingRefreshes(bool*)], add a null check, r=mccr
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 18 Oct 2013 00:50:24 +0300
changeset 151170 999ed39dc0e721f9279ae38687c1188af91f0177
parent 151169 91993a2ea9987da5de4eb2951f7611fd7035ec7d
child 151171 2668b492d8527a3b5609293de82b8e5de511063c
push id35098
push useropettay@mozilla.com
push dateThu, 17 Oct 2013 21:51:58 +0000
treeherdermozilla-inbound@999ed39dc0e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr
bugs927586
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 927586 - [@ nsDOMWindowUtils::GetIsTestControllingRefreshes(bool*)], add a null check, r=mccr
dom/base/nsDOMWindowUtils.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2380,18 +2380,19 @@ nsDOMWindowUtils::RestoreNormalRefresh()
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetIsTestControllingRefreshes(bool *aResult)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
+  nsPresContext* pc = GetPresContext();
   *aResult =
-    GetPresContext()->RefreshDriver()->IsTestControllingRefreshesEnabled();
+    pc ? pc->RefreshDriver()->IsTestControllingRefreshesEnabled() : false;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::ComputeAnimationDistance(nsIDOMElement* aElement,
                                            const nsAString& aProperty,
                                            const nsAString& aValue1,