diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 73e1254ee1..f3b001c993 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -163,6 +163,8 @@ void GuiSpellchecker::on_replacePB_clicked() LYXERR(Debug::GUI, "Replace (" << replacement << ")"); BufferView * bv = const_cast(bufferview()); + if (!bv->cursor().inTexted()) + return; cap::replaceSelectionWithString(bv->cursor(), replacement, true); bv->buffer().markDirty(); // If we used an LFUN, we would not need that