зеркало из https://github.com/mozilla/gecko-dev.git
fix for crash in bug #25339, r=hyatt. the problem is someone is trying to select a null
element in the tree (from js). now, on to fix that problem.
This commit is contained in:
Родитель
c7d4d2df98
Коммит
5f82aeba31
|
@ -151,6 +151,9 @@ nsXULTreeElement::GetSelectedCells(nsIDOMNodeList** aSelectedCells)
|
|||
NS_IMETHODIMP
|
||||
nsXULTreeElement::SelectItem(nsIDOMXULElement* aTreeItem)
|
||||
{
|
||||
NS_ASSERTION(aTreeItem, "trying to select a null tree item");
|
||||
if (!aTreeItem) return NS_OK;
|
||||
|
||||
// Sanity check. If we're the only item, just bail.
|
||||
PRUint32 length;
|
||||
mSelectedItems->GetLength(&length);
|
||||
|
@ -251,6 +254,9 @@ nsXULTreeElement::ClearCellSelection()
|
|||
void
|
||||
nsXULTreeElement::AddItemToSelectionInternal(nsIDOMXULElement* aTreeItem)
|
||||
{
|
||||
NS_ASSERTION(aTreeItem,"attepting to add a null tree item to the selection");
|
||||
if (!aTreeItem) return;
|
||||
|
||||
// Without clearing the selection, perform the add.
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aTreeItem);
|
||||
content->SetAttribute(kNameSpaceID_None, kSelectedAtom, nsAutoString("true"), PR_TRUE);
|
||||
|
|
|
@ -151,6 +151,9 @@ nsXULTreeElement::GetSelectedCells(nsIDOMNodeList** aSelectedCells)
|
|||
NS_IMETHODIMP
|
||||
nsXULTreeElement::SelectItem(nsIDOMXULElement* aTreeItem)
|
||||
{
|
||||
NS_ASSERTION(aTreeItem, "trying to select a null tree item");
|
||||
if (!aTreeItem) return NS_OK;
|
||||
|
||||
// Sanity check. If we're the only item, just bail.
|
||||
PRUint32 length;
|
||||
mSelectedItems->GetLength(&length);
|
||||
|
@ -251,6 +254,9 @@ nsXULTreeElement::ClearCellSelection()
|
|||
void
|
||||
nsXULTreeElement::AddItemToSelectionInternal(nsIDOMXULElement* aTreeItem)
|
||||
{
|
||||
NS_ASSERTION(aTreeItem,"attepting to add a null tree item to the selection");
|
||||
if (!aTreeItem) return;
|
||||
|
||||
// Without clearing the selection, perform the add.
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aTreeItem);
|
||||
content->SetAttribute(kNameSpaceID_None, kSelectedAtom, nsAutoString("true"), PR_TRUE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче