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

peerprofile: Check the result of `open()`


Change-Id: Ib5af845fbdc039a8986c680ad650ce04aed66bcc
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent c53ef429
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,12 @@ bool PeerProfileEditor::save(const Person* pers) ...@@ -74,7 +74,12 @@ bool PeerProfileEditor::save(const Person* pers)
const auto& result = pers->toVCard(); const auto& result = pers->toVCard();
QFile file {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.write(result);
file.close(); file.close();
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment