Skip to content

Commit

Permalink
Bug 1857233 - Fix null pointer crash [@ GetColumnHeaderCellsCB ]. r=J…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmelin committed Oct 9, 2023
1 parent b428371 commit 9f36e5d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions accessible/atk/nsMaiInterfaceTableCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ static AtkObject* GetTableCB(AtkTableCell* aTableCell) {
if (!acc) {
return nullptr;
}
TableAccessible* table = acc->AsTableCell()->Table();
TableCellAccessible* cell = acc->AsTableCell();
if (!cell) {
return nullptr;
}
TableAccessible* table = cell->Table();
if (!table) {
return nullptr;
}
Expand All @@ -84,8 +88,12 @@ static GPtrArray* GetColumnHeaderCellsCB(AtkTableCell* aCell) {
if (!acc) {
return nullptr;
}
TableCellAccessible* cell = acc->AsTableCell();
if (!cell) {
return nullptr;
}
AutoTArray<Accessible*, 10> headers;
acc->AsTableCell()->ColHeaderCells(&headers);
cell->ColHeaderCells(&headers);
if (headers.IsEmpty()) {
return nullptr;
}
Expand All @@ -105,8 +113,12 @@ static GPtrArray* GetRowHeaderCellsCB(AtkTableCell* aCell) {
if (!acc) {
return nullptr;
}
TableCellAccessible* cell = acc->AsTableCell();
if (!cell) {
return nullptr;
}
AutoTArray<Accessible*, 10> headers;
acc->AsTableCell()->RowHeaderCells(&headers);
cell->RowHeaderCells(&headers);
if (headers.IsEmpty()) {
return nullptr;
}
Expand Down

0 comments on commit 9f36e5d

Please sign in to comment.