Avoid potential nullptr access for Document, use reference instead
ClosedPublic

Authored by bruns on Dec 2 2018, 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
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5657
Build 5675: arc lint + arc unit
bruns created this revision.Dec 2 2018, 4:03 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptDec 2 2018, 4:03 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Dec 2 2018, 4:03 PM

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

bruns added a comment.Dec 2 2018, 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.Dec 2 2018, 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.Dec 3 2018, 6:43 PM
This revision is now accepted and ready to land.Dec 3 2018, 6:43 PM
This revision was automatically updated to reflect the committed changes.