SUMMARY TextCreator::create() creates a locate instance using `KSyntaxHighlighting::SyntaxHighlighter syntaxHighlighter;` which leads to a nullptr dereference in `QSyntaxHighlighter::QSyntaxHighlighter(QObject*)`. STEPS TO REPRODUCE 1. Open a directory in Dolphin, activate hover-on previews 2. Hover the cursor over a .txt file OBSERVED RESULT kdeinit5 crashes because of the nullptr dereference. EXPECTED RESULT No crash. SOFTWARE/OS VERSIONS Happens on Mac & Linux; as far as I can tell this should happen with the current Qt5 release and the most recent versions of kio-extras and KSyntaxHighlighting. ADDITIONAL INFORMATION The function should call `KSyntaxHighlighting::SyntaxHighlighter syntaxHighlighter(&textDocument);` which makes the later call to `setDocument()` unnecessary.
Hmm, all At versions we support should have the null check, we submitted that ourselves https://code.qt.io/cgit/qt/qtbase.git/commit/src/gui/text/qsyntaxhighlighter.cpp?id=16cb578a8d102f1c937dcc3a07b88b24c9ed685a
(You could have "unprivatised" the argument-less ctor or added a default null value in the fix ;) )