]> git.lyx.org Git - lyx.git/commitdiff
fix cut and paste crash
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 7 Feb 2005 10:01:43 +0000 (10:01 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 7 Feb 2005 10:01:43 +0000 (10:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9594 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/CutAndPaste.C

index 73ac6fde33662bff24c6e5fd00fa3d2abcb29ff7..4f7f33316fa855986389deb399ae5b69f3b2eee1 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-07  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * CutAndPaste.C (pasteSelectionHelper): fix a crash
+
 2005-02-03  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * buffer.C: format up to 241.
index b6b7abd280e8204c5dcff53e5d8dcdae76df5ba7..32bbbdf7a393878b68a2c48aee7d79ceb908a59f 100644 (file)
@@ -116,7 +116,8 @@ pasteSelectionHelper(Buffer const & buffer, ParagraphList & pars,
 
        // Convert newline to paragraph break in ERT inset.
        // This should not be here!
-       if (pars[pit].inInset()->lyxCode() == InsetBase::ERT_CODE) {
+       if (pars[pit].inInset() &&
+           pars[pit].inInset()->lyxCode() == InsetBase::ERT_CODE) {
                for (ParagraphList::size_type i = 0; i < insertion.size(); ++i) {
                        for (pos_type j = 0; j < insertion[i].size(); ++j) {
                                if (insertion[i].isNewline(j)) {