Check null pointer for text2FindW to prevent potential crashes

Fix #17086, close #17087
This commit is contained in:
Ekopalypse 2025-10-18 19:10:33 +02:00 committed by Don Ho
parent e214d73fe2
commit cf0a5c8edc

View File

@ -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);
}
}