From 77db4e7e28cd861c07c442bc0c0cf5d2f0346fb3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Dec 2010 14:18:41 +0000 Subject: Resolves: rhbz#660342 Undo/Redo crash with postits (cherry picked from commit 1b58066892daa9365d23b39d7439fbbe7d562b13) --- sw/source/core/undo/SwUndoField.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx index 6d93bfc7d9..7bb38c30d8 100644 --- a/sw/source/core/undo/SwUndoField.cxx +++ b/sw/source/core/undo/SwUndoField.cxx @@ -87,7 +87,8 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc() void SwUndoFieldFromDoc::Undo( SwUndoIter& ) { SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition()); - const SwField * pField = pTxtFld->GetFld().GetFld(); + + const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL; if (pField) { @@ -102,7 +103,7 @@ void SwUndoFieldFromDoc::Undo( SwUndoIter& ) void SwUndoFieldFromDoc::Redo( SwUndoIter& ) { SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition()); - const SwField * pField = pTxtFld->GetFld().GetFld(); + const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL; if (pField) { -- cgit v1.2.3