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

Commit 0aca434

Browse files
committed
[[ Bug 10999 ]] fix crash when trying to flip referenced image
1 parent 33ac968 commit 0aca434

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

engine/src/cmdsc.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,8 @@ Parse_stat MCFlip::parse(MCScriptPoint &sp)
12981298
Exec_stat MCFlip::exec(MCExecPoint &ep)
12991299
{
13001300
bool t_created_selection;
1301+
MColdtool = MCcurtool;
1302+
13011303
if (image != NULL)
13021304
{
13031305
MCObject *optr;
@@ -1313,22 +1315,23 @@ Exec_stat MCFlip::exec(MCExecPoint &ep)
13131315
return ES_ERROR;
13141316
}
13151317
MCImage *iptr = (MCImage *)optr;
1316-
MColdtool = MCcurtool;
13171318
iptr->selimage();
13181319
t_created_selection = true;
13191320
}
13201321
else
13211322
t_created_selection = false;
13221323

13231324
if (MCactiveimage != NULL)
1325+
{
13241326
MCactiveimage->flipsel(direction == FL_HORIZONTAL);
13251327

1326-
if (t_created_selection)
1327-
{
1328-
MCcurtool = MColdtool;
1329-
MCactiveimage -> endsel();
1328+
// IM-2013-06-28: [[ Bug 10999 ]] ensure MCactiveimage is not null when calling endsel() method
1329+
if (t_created_selection)
1330+
MCactiveimage -> endsel();
13301331
}
13311332

1333+
MCcurtool = MColdtool;
1334+
13321335
return ES_NORMAL;
13331336
}
13341337

0 commit comments

Comments
 (0)