Resolves: rhbz#660342 Undo/Redo crash with postits

(cherry picked from commit 1b58066892daa9365d23b39d7439fbbe7d562b13)
This commit is contained in:
Caolán McNamara 2010-12-22 14:18:41 +00:00
parent ff50442f39
commit 2912732d42

View file

@ -87,7 +87,8 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
void SwUndoFieldFromDoc::Undo( SwUndoIter& ) void SwUndoFieldFromDoc::Undo( SwUndoIter& )
{ {
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition()); SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld();
const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
if (pField) if (pField)
{ {
@ -102,7 +103,7 @@ void SwUndoFieldFromDoc::Undo( SwUndoIter& )
void SwUndoFieldFromDoc::Redo( SwUndoIter& ) void SwUndoFieldFromDoc::Redo( SwUndoIter& )
{ {
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition()); SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld(); const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
if (pField) if (pField)
{ {