diff --git a/src/frontends/qt/GuiInputMethod.cpp b/src/frontends/qt/GuiInputMethod.cpp
index b9348328d9..aaf4b4536a 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -124,6 +124,8 @@ GuiInputMethod::~GuiInputMethod()
 
 void GuiInputMethod::toggleInputMethodAcceptance()
 {
+	if (d->cur_->empty()) return;
+
 	if (guiApp->platformName() != "cocoa")
 		// Since QInputMethod::locale() doesn't work on other systems, use
 		// language at the cursor point to infer the current input language
