Bug 745502 - Fix a null-pointer exception in pushState. r=smaug
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 16 Apr 2012 19:54:08 +1000
changeset 91750 904830fc136772c0060912c17a0833a55d4ffca5
parent 91749 61088f8aa842fb7042453ce2b2565492b32322d8
child 91751 3302067526f60dead7c7c5181de5831bc4b32d21
push id22472
push usereakhgari@mozilla.com
push dateMon, 16 Apr 2012 15:03:21 +0000
treeherdermozilla-central@0066df252596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs745502
milestone14.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 745502 - Fix a null-pointer exception in pushState. r=smaug
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9721,17 +9721,22 @@ nsDocShell::AddState(nsIVariant *aData, 
 
             if (!principal ||
                 NS_FAILED(principal->CheckMayLoad(newURI, true))) {
 
                 return NS_ERROR_DOM_SECURITY_ERR;
             }
         }
 
-        mCurrentURI->Equals(newURI, &equalURIs);
+        if (mCurrentURI) {
+            mCurrentURI->Equals(newURI, &equalURIs);
+        }
+        else {
+            equalURIs = false;
+        }
 
     } // end of same-origin check
 
     nsCOMPtr<nsISHistory> sessionHistory = mSessionHistory;
     if (!sessionHistory) {
         // Get the handle to SH from the root docshell
         GetRootSessionHistory(getter_AddRefs(sessionHistory));
     }