Bug 1475964 - Add null checks in nsMaiInterfaceTableCell.cpp. r=davidb
authorRobert Bartlensky <rbartlensky@mozilla.com>
Mon, 16 Jul 2018 15:16:42 +0100
changeset 821129 b3cfdf00c7f26d82137bcd23d5d0eca732152d6b
parent 821128 11b4729e92ecbf99a27d956321295e6a1309ca05
child 821130 a9c6b8e2e0ea933cabd5f31a5bf9250712978fd3
push id117018
push userbmo:sfoster@mozilla.com
push dateSat, 21 Jul 2018 04:05:10 +0000
reviewersdavidb
bugs1475964
milestone63.0a1
Bug 1475964 - Add null checks in nsMaiInterfaceTableCell.cpp. r=davidb MozReview-Commit-ID: 5RSioCelGo3
accessible/atk/nsMaiInterfaceTableCell.cpp
--- a/accessible/atk/nsMaiInterfaceTableCell.cpp
+++ b/accessible/atk/nsMaiInterfaceTableCell.cpp
@@ -50,16 +50,19 @@ GetRowSpanCB(AtkTableCell* aCell)
   return 0;
 }
 
 static gboolean
 GetPositionCB(AtkTableCell* aCell, gint* aRow, gint* aCol)
 {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     TableCellAccessible* cell = accWrap->AsTableCell();
+    if (!cell) {
+      return false;
+    }
     *aRow = cell->RowIdx();
     *aCol = cell->ColIdx();
     return true;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     uint32_t rowIdx = 0, colIdx = 0;
     proxy->GetPosition(&rowIdx, &colIdx);
@@ -71,16 +74,19 @@ GetPositionCB(AtkTableCell* aCell, gint*
   return false;
 }
 
 static gboolean
 GetColumnRowSpanCB(AtkTableCell* aCell, gint* aCol, gint* aRow,
                    gint* aColExtent, gint* aRowExtent) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     TableCellAccessible* cellAcc = accWrap->AsTableCell();
+    if (!cellAcc) {
+      return false;
+    }
     *aCol = cellAcc->ColIdx();
     *aRow = cellAcc->RowIdx();
     *aColExtent = cellAcc->ColExtent();
     *aRowExtent = cellAcc->ColExtent();
     return true;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {