]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMacro.cpp
Only set buffer if it is not null.
[lyx.git] / src / mathed / InsetMathMacro.cpp
index 2ecef18a52154cd8456306200a00eedd98c1dca6..f1a84cd57343da6d5b8c8b29a8e741bd62d4d546 100644 (file)
@@ -307,7 +307,11 @@ InsetMathMacro::InsetMathMacro(Buffer * buf, docstring const & name)
 InsetMathMacro::InsetMathMacro(InsetMathMacro const & that)
        : InsetMathNest(that), d(new Private(*that.d))
 {
-       setBuffer(*that.buffer_);
+       // FIXME This should not really be necessary, but when we are
+       // initializing the table of global macros, we create macros
+       // with no associated Buffer.
+       if (that.buffer_)
+               setBuffer(*that.buffer_);
        d->updateChildren(this);
 }