]> git.lyx.org Git - lyx.git/commitdiff
avoid crash when there is no buffer (bug #6548)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 25 Feb 2010 11:36:31 +0000 (11:36 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 25 Feb 2010 11:36:31 +0000 (11:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33564 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetQuotes.cpp

index 0c265fcfe75479527a4dea5ff3e14501707d27bc..e56d809decf53fd6b92a0cf43d195b7f30306aef 100644 (file)
@@ -185,12 +185,13 @@ void InsetQuotes::parseString(string const & s)
 
 docstring InsetQuotes::displayString() const
 {
-       Language const * loclang = buffer().params().language;
+       Language const * loclang = isBufferValid() ? buffer().params().language : 0;
        int const index = quote_index[side_][language_];
        docstring retdisp = docstring(1, display_quote_char[times_][index]);
 
        // in french, spaces are added inside double quotes
-       if (times_ == DoubleQuotes && prefixIs(loclang->code(), "fr")) {
+       // FIXME: this should be done by a separate quote type.
+       if (times_ == DoubleQuotes && loclang && prefixIs(loclang->code(), "fr")) {
                if (side_ == LeftQuote)
                        retdisp += ' ';
                else