From d143da6750863537d86d57e2c469fad51f72dfd8 Mon Sep 17 00:00:00 2001 From: Morgan Rae Reschenberg Date: Tue, 13 Sep 2022 19:57:53 +0000 Subject: [PATCH] Bug 1788547: Null check table acc exists before firing styling changed event, add assert for debugging r=Jamie Differential Revision: https://phabricator.services.mozilla.com/D156987 --- accessible/base/nsAccessibilityService.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index e07de2e4d5f7..f99cacfc928c 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -568,10 +568,11 @@ void nsAccessibilityService::TableLayoutGuessMaybeChanged( PresShell* aPresShell, nsIContent* aContent) { if (DocAccessible* document = GetDocAccessible(aPresShell)) { if (LocalAccessible* acc = document->GetAccessible(aContent)) { - LocalAccessible* table = nsAccUtils::TableFor(acc); - document->FireDelayedEvent( - nsIAccessibleEvent::EVENT_TABLE_STYLING_CHANGED, table); - document->QueueCacheUpdate(table, CacheDomain::Table); + if (LocalAccessible* table = nsAccUtils::TableFor(acc)) { + document->FireDelayedEvent( + nsIAccessibleEvent::EVENT_TABLE_STYLING_CHANGED, table); + document->QueueCacheUpdate(table, CacheDomain::Table); + } } } }