tdf#154551 check pointer before use
Change-Id: Ied215ea393760f246128610c5b7b4d50ab211f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151300
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 4ae5263..6ea4aba 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -541,7 +541,7 @@ SwHTMLWriter& OutHTML_SwFormatField( SwHTMLWriter& rWrt, const SfxPoolItem& rHt
{
const SwTextField *pTextField = rField.GetTextField();
OSL_ENSURE( pTextField, "Where is the txt fld?" );
if( pTextField && rWrt.m_pDoc->GetDocShell() )
if (pTextField && rWrt.m_pDoc->GetDocShell() && rWrt.m_pDoc->GetDocShell()->GetView())
{
// ReqIF-XHTML doesn't allow specifying a background color.
const SwViewOption* pViewOptions = rWrt.m_pDoc->GetDocShell()->GetView()->GetWrtShell().GetViewOptions();