don't crash if parent is null when asking for mouse coordinates.

git-svn-id: svn://10.0.0.236/trunk@37637 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%netscape.com
1999-07-01 03:26:43 +00:00
parent e0de8e6170
commit fed08cf519
2 changed files with 4 additions and 4 deletions

View File

@@ -225,7 +225,7 @@ NS_METHOD nsDOMEvent::GetScreenX(PRInt32* aScreenX)
nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget;
//Add extra since loop will free one.
NS_ADDREF(parent);
NS_IF_ADDREF(parent);
nsIWidget* tmp;
while (nsnull != parent) {
parent->GetBounds(bounds);
@@ -246,7 +246,7 @@ NS_METHOD nsDOMEvent::GetScreenY(PRInt32* aScreenY)
nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget;
//Add extra since loop will free one.
NS_ADDREF(parent);
NS_IF_ADDREF(parent);
nsIWidget* tmp;
while (nsnull != parent) {
parent->GetBounds(bounds);

View File

@@ -225,7 +225,7 @@ NS_METHOD nsDOMEvent::GetScreenX(PRInt32* aScreenX)
nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget;
//Add extra since loop will free one.
NS_ADDREF(parent);
NS_IF_ADDREF(parent);
nsIWidget* tmp;
while (nsnull != parent) {
parent->GetBounds(bounds);
@@ -246,7 +246,7 @@ NS_METHOD nsDOMEvent::GetScreenY(PRInt32* aScreenY)
nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget;
//Add extra since loop will free one.
NS_ADDREF(parent);
NS_IF_ADDREF(parent);
nsIWidget* tmp;
while (nsnull != parent) {
parent->GetBounds(bounds);