]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #5968: Assertion while reading a document with multiple equation labels.
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 5 Nov 2009 00:38:09 +0000 (00:38 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 5 Nov 2009 00:38:09 +0000 (00:38 +0000)
This is another ad-hoc solution for the problem of a zero buffer pointer while reading a document or when using cut&paste.

This simple solution would be suitable for branch.

see also e.g. r29085, r28319, bug #5688.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31861 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index abb35e479f1481719238b2310a4eed0af60140a3..2d16cc20a18b01a4b88bb9c77a397bb506d664b7 100644 (file)
@@ -507,9 +507,13 @@ void InsetMathHull::label(row_type row, docstring const & label)
                        label_[row] = dummy_pointer;
                        // We need an update of the Buffer reference cache.
                        // This is achieved by updateLabels().
-                       buffer().updateLabels();
+                       if (buffer_)
+                               buffer().updateLabels();
                } else {
-                       label_[row]->updateCommand(label);
+                       if (buffer_)
+                               label_[row]->updateCommand(label);
+                       else
+                               label_[row]->setParam("name", label);
                }
                return;
        }