Don't crash if fopen fails
ClosedPublic

Authored by svuorela on May 1 2018, 7:10 PM.

Details

Summary

If we have a qrc url, all checks so far fails, and this one returns null.

It might also be possible to get here in some race condition.

Diff Detail

Repository
R223 Okular
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
svuorela created this revision.May 1 2018, 7:10 PM
Restricted Application added a project: Okular. · View Herald TranscriptMay 1 2018, 7:10 PM
Restricted Application added a subscriber: Okular. · View Herald Transcript
svuorela requested review of this revision.May 1 2018, 7:10 PM
aacid requested changes to this revision.May 1 2018, 7:51 PM

Please add an emit error similar to the one a few lines below

This revision now requires changes to proceed.May 1 2018, 7:51 PM
svuorela updated this revision to Diff 33436.May 1 2018, 8:00 PM

Fix review comments

aacid accepted this revision.May 1 2018, 8:09 PM

I don't support your quest for making qrc work but this is a valid check so nothing against it. Before you commit please try to add some spaces around the if to mimc the rest of the file code style.

This revision is now accepted and ready to land.May 1 2018, 8:09 PM

It is not a quest to make qrc work. it is just a "don't crash if such a thing is received". Will add some spaces.

svuorela updated this revision to Diff 33444.May 1 2018, 8:24 PM

Add spaces around if.

This revision was automatically updated to reflect the committed changes.