mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Patch from alecf to do a null pointer check on argument to GetSelectedIndex().
This commit is contained in:
parent
6da324eafb
commit
c670e17ce2
@ -546,6 +546,8 @@ PRInt32 nsListControlFrame::GetSelectedIndex(nsIFrame *aHitFrame)
|
||||
PRInt32 index = kNothingSelected;
|
||||
// Get the content of the frame that was selected
|
||||
nsIContent* selectedContent = nsnull;
|
||||
NS_ASSERTION(aHitFrame, "No frame for html <select> element\n");
|
||||
if (aHitFrame) {
|
||||
aHitFrame->GetContent(&selectedContent);
|
||||
|
||||
// Search the list of option elements looking for a match
|
||||
@ -568,7 +570,7 @@ PRInt32 nsListControlFrame::GetSelectedIndex(nsIFrame *aHitFrame)
|
||||
}
|
||||
NS_RELEASE(options);
|
||||
}
|
||||
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
@ -546,6 +546,8 @@ PRInt32 nsListControlFrame::GetSelectedIndex(nsIFrame *aHitFrame)
|
||||
PRInt32 index = kNothingSelected;
|
||||
// Get the content of the frame that was selected
|
||||
nsIContent* selectedContent = nsnull;
|
||||
NS_ASSERTION(aHitFrame, "No frame for html <select> element\n");
|
||||
if (aHitFrame) {
|
||||
aHitFrame->GetContent(&selectedContent);
|
||||
|
||||
// Search the list of option elements looking for a match
|
||||
@ -568,7 +570,7 @@ PRInt32 nsListControlFrame::GetSelectedIndex(nsIFrame *aHitFrame)
|
||||
}
|
||||
NS_RELEASE(options);
|
||||
}
|
||||
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user