summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/access/AccessibilityCheck.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx
index 2e3219765e22..36226b028937 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1029,10 +1029,12 @@ public:
return;
// Check if it's a real caption
- const SwNode* aStartFly = pCurrent->FindFlyStartNode();
- if (aStartFly
- && aStartFly->GetFlyFormat()->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR)
- return;
+ if (const SwNode* pStartFly = pCurrent->FindFlyStartNode())
+ {
+ const SwFrameFormat* pFormat = pStartFly->GetFlyFormat();
+ if (!pFormat || pFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR)
+ return;
+ }
auto aIter = SwIterator<SwTextFrame, SwTextNode, sw::IteratorMode::UnwrapMulti>(*pTextNode);
auto nCount = 0;