Bug 745530 - Check that the decoded and unescaped ref is not empty. r=smaug

This commit is contained in:
Oonishi Atsushi 2012-05-08 18:49:14 -04:00
parent 786a8933a1
commit 42c07a9d94

View File

@ -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 {