9f9f578
From 76cf006837fdb687ce0a34ac673f3b8531b19700 Mon Sep 17 00:00:00 2001
9f9f578
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
9f9f578
Date: Thu, 15 Sep 2011 12:32:51 +0100
9f9f578
Subject: [PATCH] Resolves: rhbz#738255 avoid crash on NULL pointer
9f9f578
9f9f578
---
9f9f578
 sc/source/ui/app/inputhdl.cxx |   15 +++++++++------
9f9f578
 1 files changed, 9 insertions(+), 6 deletions(-)
9f9f578
9f9f578
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
9f9f578
index 1524397..c30a8fd 100644
9f9f578
--- a/sc/source/ui/app/inputhdl.cxx
9f9f578
+++ b/sc/source/ui/app/inputhdl.cxx
9f9f578
@@ -2469,13 +2469,16 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
9f9f578
             ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
9f9f578
             // #i67990# don't use pLastPattern in EnterHandler
9f9f578
             const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab() );
9f9f578
-            SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
9f9f578
-            // without conditional format, as in ScColumn::SetString
9f9f578
-            sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
9f9f578
-            double nVal;
9f9f578
-            if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
9f9f578
+            if (pPattern)
9f9f578
             {
9f9f578
-                bSpellErrors = false;       // ignore the spelling errors
9f9f578
+                SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
9f9f578
+                // without conditional format, as in ScColumn::SetString
9f9f578
+                sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
9f9f578
+                double nVal;
9f9f578
+                if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
9f9f578
+                {
9f9f578
+                    bSpellErrors = false;       // ignore the spelling errors
9f9f578
+                }
9f9f578
             }
9f9f578
         }
9f9f578
     }
9f9f578
-- 
9f9f578
1.7.6
9f9f578