From a43f7ab64c6ec671db054f0984cc51c283da2dc5 Mon Sep 17 00:00:00 2001 From: "aaronl%netscape.com" Date: Mon, 2 Jun 2003 08:42:55 +0000 Subject: [PATCH] Bug 207554. Crash in nshtmlselectoptionaccessible::getaccnextsibling(). r=kyle, sr=alecf --- accessible/src/html/nsHTMLSelectAccessible.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/accessible/src/html/nsHTMLSelectAccessible.cpp b/accessible/src/html/nsHTMLSelectAccessible.cpp index d3785f7896fa..07f38ab0f631 100644 --- a/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -462,7 +462,18 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNextSibling(nsIAccessible **aA // Get next sibling and if found create and return an accessible for it // When getting the next sibling of an SelectOption we could be working with // either an optgroup or an option. We process this tree as flat. + *aAccNextSibling = nsnull; + if (mNextSibling) { + if (mNextSibling != DEAD_END_ACCESSIBLE) { + NS_IF_ADDREF(*aAccNextSibling = mNextSibling); + } + return NS_OK; + } + if (!mParent) { + // Don't try the following algorithm without a parent select accessible + return NS_OK; + } nsCOMPtr next = mDOMNode, currentNode; nsCOMPtr accService(do_GetService("@mozilla.org/accessibilityService;1"));