mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-13 01:59:22 -04:00
Fix crash upon exiting interactive mode if there is no current database.
This commit is contained in:
parent
794cc1eeab
commit
26afdb39d3
1 changed files with 6 additions and 4 deletions
|
@ -149,8 +149,7 @@ void enterInteractiveMode(const QStringList& arguments)
|
||||||
prompt += "> ";
|
prompt += "> ";
|
||||||
command = reader->readLine(prompt);
|
command = reader->readLine(prompt);
|
||||||
if (reader->isFinished()) {
|
if (reader->isFinished()) {
|
||||||
currentDatabase->releaseData();
|
break;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = Utils::splitCommandString(command);
|
QStringList args = Utils::splitCommandString(command);
|
||||||
|
@ -163,14 +162,17 @@ void enterInteractiveMode(const QStringList& arguments)
|
||||||
errorTextStream << QObject::tr("Unknown command %1").arg(args[0]) << "\n";
|
errorTextStream << QObject::tr("Unknown command %1").arg(args[0]) << "\n";
|
||||||
continue;
|
continue;
|
||||||
} else if (cmd->name == "quit" || cmd->name == "exit") {
|
} else if (cmd->name == "quit" || cmd->name == "exit") {
|
||||||
currentDatabase->releaseData();
|
break;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd->currentDatabase = currentDatabase;
|
cmd->currentDatabase = currentDatabase;
|
||||||
cmd->execute(args);
|
cmd->execute(args);
|
||||||
currentDatabase = cmd->currentDatabase;
|
currentDatabase = cmd->currentDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentDatabase) {
|
||||||
|
currentDatabase->releaseData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue