]> git.lyx.org Git - features.git/commitdiff
Fix crash when removing last converter (bug 8178)
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 29 May 2012 12:21:29 +0000 (14:21 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 29 May 2012 12:21:29 +0000 (14:21 +0200)
src/frontends/qt4/GuiPrefs.cpp

index 2302cc9fae5ab33cdf3794b906f55b6496da31fc..39f68412cd95b06e4337dcedf83951207498074b 100644 (file)
@@ -1694,10 +1694,16 @@ void PrefConverters::updateButtons()
        bool const valid = !(converterED->text().isEmpty()
                || from.name() == to.name());
 
-       int const cnr = convertersLW->currentItem()->type();
-       Converter const & c = form_->converters().get(cnr);
-       string const old_command = c.command;
-       string const old_flag = c.flags;
+       string old_command;
+       string old_flag;
+
+       if (convertersLW->count() > 0) {
+               int const cnr = convertersLW->currentItem()->type();
+               Converter const & c = form_->converters().get(cnr);
+               old_command = c.command;
+               old_flag = c.flags;
+       }
+
        string const new_command = fromqstr(converterED->text());
        string const new_flag = fromqstr(converterFlagED->text());