]> git.lyx.org Git - features.git/commitdiff
GuiViewSource - prevent null-pointer crash if backend format is not found.
authorPavel Sanda <sanda@lyx.org>
Wed, 9 May 2012 07:14:11 +0000 (09:14 +0200)
committerPavel Sanda <sanda@lyx.org>
Wed, 9 May 2012 07:14:55 +0000 (09:14 +0200)
Patch from John Tapsell.

src/frontends/qt4/GuiViewSource.cpp

index aeaf105b7665ae851e0010bf9cde797bac6336de..17ba47f83636ea1c21955a545f041a61bd0d883e 100644 (file)
@@ -205,9 +205,10 @@ void ViewSourceWidget::updateDefaultFormat()
        for (; it != en; ++it) {
                string const format = *it;
                Format const * fmt = formats.getFormat(format);
-               if (!fmt)
+               if (!fmt) {
                        LYXERR0("Can't find format for backend " << format << "!");
-               else if (fmt->name() == "lyx")
+            continue;
+        } else if (fmt->name() == "lyx")
                        // we can't presently display the LyX format itself
                        continue;