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 2022-05-01 15:47:38 -04:00
parent 0f3a2531e7
commit b5e0572155

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;