Fix for bug #4824. Added NULL pointer checks in GoToAnchor()

This commit is contained in:
troy%netscape.com 1999-04-09 04:28:15 +00:00
Родитель 739bea1432
Коммит a4baddf3dc
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1448,7 +1448,7 @@ PresShell::GoToAnchor(const nsString& aAnchorName) const
// Find the element with the specified id
rv = htmlDoc->GetElementById(aAnchorName, getter_AddRefs(element));
if (NS_SUCCEEDED(rv)) {
if (NS_SUCCEEDED(rv) && element) {
// Get the nsIContent interface, because that's what we need to
// get the primary frame
rv = element->QueryInterface(kIContentIID, getter_AddRefs(content));
@ -1459,7 +1459,7 @@ PresShell::GoToAnchor(const nsString& aAnchorName) const
rv = xmlDoc->GetContentById(aAnchorName, getter_AddRefs(content));
}
if (NS_SUCCEEDED(rv)) {
if (NS_SUCCEEDED(rv) && content) {
nsIFrame* frame;
// Get the primary frame

Просмотреть файл

@ -1448,7 +1448,7 @@ PresShell::GoToAnchor(const nsString& aAnchorName) const
// Find the element with the specified id
rv = htmlDoc->GetElementById(aAnchorName, getter_AddRefs(element));
if (NS_SUCCEEDED(rv)) {
if (NS_SUCCEEDED(rv) && element) {
// Get the nsIContent interface, because that's what we need to
// get the primary frame
rv = element->QueryInterface(kIContentIID, getter_AddRefs(content));
@ -1459,7 +1459,7 @@ PresShell::GoToAnchor(const nsString& aAnchorName) const
rv = xmlDoc->GetContentById(aAnchorName, getter_AddRefs(content));
}
if (NS_SUCCEEDED(rv)) {
if (NS_SUCCEEDED(rv) && content) {
nsIFrame* frame;
// Get the primary frame