Fix crash when removing last converter (bug 8178)

This commit is contained in:
Juergen Spitzmueller 2012-05-29 14:21:29 +02:00
parent 9fc92f783c
commit ab3491adef

View File

@ -1694,10 +1694,16 @@ void PrefConverters::updateButtons()
bool const valid = !(converterED->text().isEmpty()
|| from.name() == to.name());
string old_command;
string old_flag;
if (convertersLW->count() > 0) {
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;
old_command = c.command;
old_flag = c.flags;
}
string const new_command = fromqstr(converterED->text());
string const new_flag = fromqstr(converterFlagED->text());