From 42c07a9d94f1ec35fb94aeca757c4d5aa7c4d503 Mon Sep 17 00:00:00 2001 From: Oonishi Atsushi Date: Tue, 8 May 2012 18:49:14 -0400 Subject: [PATCH] Bug 745530 - Check that the decoded and unescaped ref is not empty. r=smaug --- docshell/base/nsDocShell.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 0c7909c4c543..3cf5a86e5af6 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -9323,7 +9323,10 @@ nsDocShell::ScrollToAnchor(nsACString & aCurHash, nsACString & aNewHash, // success condition for us (we want to update the session history // with the new URI no matter whether we actually scrolled // somewhere). - shell->GoToAnchor(uStr, scroll); + // + // When newHashName contains "%00", unescaped string may be empty. + // And GoToAnchor asserts if we ask it to scroll to an empty ref. + shell->GoToAnchor(uStr, scroll && !uStr.IsEmpty()); } } else {