Avoid division-by-zero when vertical scrollbar is disabled

See #23763
This commit is contained in:
Paul Cornett 2023-08-12 15:54:39 -07:00
parent d847f3b039
commit 55d0b594ff

View file

@ -1810,6 +1810,9 @@ bool wxRichTextCtrl::ExtendSelection(long oldPos, long newPos, int flags)
/// This takes a _caret_ position.
bool wxRichTextCtrl::ScrollIntoView(long position, int keyCode)
{
if (!m_verticalScrollbarEnabled)
return false;
wxRichTextLine* line = GetVisibleLineForCaretPosition(position);
if (!line)