mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-12-05 04:39:43 +01:00
Check null pointer for text2FindW to prevent potential crashes
Fix #17086, close #17087
This commit is contained in:
parent
e214d73fe2
commit
cf0a5c8edc
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user