# HG changeset patch
# User Henning Brinkmann <hbrinkm@openoffice.org>
# Date 1249385159 -7200
# Node ID a9d3788736ef418b13a331cf09fd3fd1523732ea
# Parent  f922f6bf46e55c57a35b1bb9937a7e831288e132
#i102844# robustness: check for NULL pointer to prevent crash

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3710,8 +3710,17 @@
         UINT16 nHeight = rItem.GetBaseHeight() + rItem.GetRubyHeight();
         rWrtWW8.InsUInt16(0x9031);
         rWrtWW8.InsUInt16(nHeight);
-	   	sal_uInt32 nPageCharSize = ItemGet<SvxFontHeightItem>(*(rWrtWW8.pStyles->GetSwFmt()),
-                RES_CHRATR_CJK_FONTSIZE).GetHeight();
+        
+        WW8WrtStyle * pStyles = rWrtWW8.pStyles;
+        SwFmt * pSwFmt = pStyles->GetSwFmt();
+                
+        sal_uInt32 nPageCharSize = 0;
+        
+        if (pSwFmt != NULL)
+        {
+            nPageCharSize = ItemGet<SvxFontHeightItem>
+            (*pSwFmt, RES_CHRATR_CJK_FONTSIZE).GetHeight();
+        }
 
 		INT32 nCharWidth = rItem.GetBaseWidth() - nPageCharSize;
 	   	INT32 nFraction = 0;
