Quick GUI: Show error if root element is missing

This commit is contained in:
Martchus 2018-12-08 19:18:35 +01:00
parent c090141ec3
commit b4750c38fe
1 changed files with 4 additions and 0 deletions

View File

@ -138,6 +138,10 @@ void Controller::load(const QString &filePath)
try {
m_file.load();
m_entryModel.setRootEntry(m_file.rootEntry());
if (!m_entryModel.rootEntry()) {
emit fileError(tr("An error occured when opening the file: root element missing"), QStringLiteral("load"));
return;
}
setFileOpen(true);
updateWindowTitle();
} catch (const CryptoException &e) {