Avoid potential nullptr access for Document, use reference instead
ClosedPublic

Authored by bruns on Sun, Dec 2, 4:03 PM.

Details

Summary

Using a TermGenerator without backing document is pointless and can
even crash when the document has been initialized with a nullptr.

Test Plan

ctest

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Sun, Dec 2, 4:03 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptSun, Dec 2, 4:03 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Sun, Dec 2, 4:03 PM

This one doesn't apply, looks like D17824 is a dependency?

bruns added a comment.Sun, Dec 2, 8:04 PM

This one doesn't apply, looks like D17824 is a dependency?

D17312

This one doesn't apply, looks like D17824 is a dependency?

D17312

Hmm no, still complains in termgeneratortest about

error: while searching for:

QString str = QString::fromLatin1("1 5 10 -3 -12, 5.6, -13.4 -7e3");

Document doc;
TermGenerator termGen(&doc);
termGen.indexText(str);

QList<QByteArray> words = allWords(doc);
bruns updated this revision to Diff 46755.Sun, Dec 2, 8:53 PM
bruns retitled this revision from Avoid potential nullptr access for Document use reference instead to Avoid potential nullptr access for Document, use reference instead.

reorder patches

astippich accepted this revision.Mon, Dec 3, 6:43 PM
This revision is now accepted and ready to land.Mon, Dec 3, 6:43 PM
This revision was automatically updated to reflect the committed changes.