Skip to content

Commit

Permalink
Prevent crash on creating debug archive in non-writeable location
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Apr 1, 2024
1 parent b0f98d5 commit e5cef0d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ QVector<ZipEntry> createDebugArchiveFileList()

void createDebugArchive(const QString &filename)
{
const auto fileInfo = QFileInfo(filename);
const auto dirInfo = QFileInfo(fileInfo.dir().absolutePath());
if (!dirInfo.isWritable()) {
QMessageBox::critical(
nullptr,
QObject::tr("Failed to create debug archive"),
QObject::tr("Could not create debug archive in selected location!")
);
return;
}

const auto entries = createDebugArchiveFileList();

KZip zip(filename);
Expand Down

0 comments on commit e5cef0d

Please sign in to comment.