Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 7c47411

Browse files
committed
[21662] Fix crash when setting group scrollbar to false while scrolling
1 parent baba29e commit 7c47411

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/notes/bugfix-21662.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash when setting the scrollbar to false while scrolling

engine/src/control.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,9 +1472,9 @@ Boolean MCControl::sbfocus(int2 x, int2 y, MCScrollbar *hsb, MCScrollbar *vsb)
14721472
{
14731473
if (state & (CS_HSCROLL | CS_VSCROLL))
14741474
{
1475-
if (state & CS_HSCROLL)
1475+
if (state & CS_HSCROLL && hsb != nil)
14761476
hsb->mfocus(x, y);
1477-
else
1477+
else if (vsb != nil)
14781478
vsb->mfocus(x, y);
14791479
readscrollbars();
14801480
MCscreen->sync(getw());

0 commit comments

Comments
 (0)