summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-12-22 14:18:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-12-22 16:05:58 +0000
commit77db4e7e28cd861c07c442bc0c0cf5d2f0346fb3 (patch)
tree98fe10b08b4afe9b6fb704c406856d0af2c3d721
parent3f54712412e94dc8ecf5c04ca52dbca89aa3fb49 (diff)
Resolves: rhbz#660342 Undo/Redo crash with postits
(cherry picked from commit 1b58066892daa9365d23b39d7439fbbe7d562b13)
-rw-r--r--sw/source/core/undo/SwUndoField.cxx5
1 files 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)
{