From cf0a5c8edc93b90af0680868cec4b83a66efca69 Mon Sep 17 00:00:00 2001 From: Ekopalypse <47723516+Ekopalypse@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:10:33 +0200 Subject: [PATCH] Check null pointer for text2FindW to prevent potential crashes Fix #17086, close #17087 --- PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp index d4fe69e6d..e3fb73ed2 100644 --- a/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp @@ -152,7 +152,11 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil } const wchar_t * text2FindW = pHighlightView->getSelectedTextToWChar(false); //do not expand selection (false) - + if (!text2FindW) + { + return; + } + highlightViewWithWord(pHighlightView, text2FindW); if (nppGUI._smartHiliteOnAnotherView && unfocusView && unfocusView->isVisible()) @@ -167,3 +171,6 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil highlightViewWithWord(unfocusView, text2FindW); } } + + +