Skip to content
Snippets Groups Projects
Commit 02f0db14 authored by Emmanuel Lepage Vallée's avatar Emmanuel Lepage Vallée Committed by Nicolas Jager
Browse files

localprofile: Check the result of `open()`


Change-Id: If958f6aa7a89ca3878482b60be5c3905502cac3e
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent 79138823
Branches
No related tags found
No related merge requests found
......@@ -78,7 +78,12 @@ bool LocalProfileEditor::save(const Profile* pro)
qDebug() << "Saving profile in:" << filename;
QFile file {filename};
file.open(QIODevice::WriteOnly);
if (Q_UNLIKELY(!file.open(QIODevice::WriteOnly))) {
qWarning() << "Can't write to" << filename;
return false;
}
file.write(result);
file.close();
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment