diff --git a/accessible/mac/GeckoTextMarker.h b/accessible/mac/GeckoTextMarker.h index 28f1961d28dc..e9c635d67aeb 100644 --- a/accessible/mac/GeckoTextMarker.h +++ b/accessible/mac/GeckoTextMarker.h @@ -56,7 +56,7 @@ class GeckoTextMarker final { int32_t mOffset; HyperTextAccessibleWrap* ContainerAsHyperTextWrap() const { - return mContainer.IsAccessible() + return (!mContainer.IsNull() && mContainer.IsAccessible()) ? static_cast( mContainer.AsAccessible()->AsHyperText()) : nullptr;