Fix Auto-Type gui guard for tests

Prevent showing gui error dialogs when no gui is present. This can occur during auto-type tests.
This commit is contained in:
Jonathan White committed 2022-09-22 06:49:07 -04:00
1 parent 3163547096
commit 6f619271c4
1 file changed
+3 -1
+3 -1
View File
@@ -335,7 +335,9 @@ void AutoType::executeAutoTypeActions(const Entry* entry,
}
if (!result.canRetry() || i == max_retries) {
MessageBox::critical(getMainWindow(), tr("Auto-Type Error"), result.errorString());
if (getMainWindow()) {
MessageBox::critical(getMainWindow(), tr("Auto-Type Error"), result.errorString());
}
emit autotypeRejected();
m_inAutoType.unlock();
return;