bug 1186536 - Bail out of ProxyTextChangeEvent() if the proxy doesn't have a wrapper r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 08 Sep 2015 17:08:16 -0400
changeset 261669 2cef846e92e44191b14235f6b02543c47ae2a61a
parent 261668 f2857622eb8729e901d71167146db012c887dfc3
child 261670 9dc18f7a238f8636c0a08ac1faff3e07e869f543
push id15125
push userphilringnalda@gmail.com
push dateThu, 10 Sep 2015 22:34:15 +0000
treeherderfx-team@0426cdc486e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1186536
milestone43.0a1
bug 1186536 - Bail out of ProxyTextChangeEvent() if the proxy doesn't have a wrapper r=davidb This probably should never happen, but it seems to sometimes in the wild, and its hard to know what caused that without a test case. So for now work around the issue by adding a null check.
accessible/windows/msaa/Platform.cpp
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -71,13 +71,18 @@ a11y::ProxyCaretMoveEvent(ProxyAccessibl
 {
 }
 
 void
 a11y::ProxyTextChangeEvent(ProxyAccessible* aText, const nsString& aStr,
                            int32_t aStart, uint32_t aLen, bool aInsert, bool)
 {
   AccessibleWrap* wrapper = WrapperFor(aText);
+  MOZ_ASSERT(wrapper);
+  if (!wrapper) {
+    return;
+  }
+
   auto text = static_cast<HyperTextAccessibleWrap*>(wrapper->AsHyperText());
   if (text) {
     ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);
   }
 }