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

Commit c78b34d

Browse files
author
Monte Goulding
committed
[Bug 13480] Back port fix for nil pointer crash
1 parent ad3c8de commit c78b34d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/notes/bugfix-13480.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Fix a potential nil pointer crash
2+

engine/src/desktop.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,18 @@ void MCPlatformHandleApplicationShutdownRequest(bool& r_terminate)
9999

100100
void MCPlatformHandleApplicationSuspend(void)
101101
{
102-
MCdefaultstackptr -> getcard() -> message(MCM_suspend);
102+
// FG-2014-09-22: [[ Bugfix 13480 ]] May have no default stack on startup
103+
if (MCdefaultstackptr)
104+
MCdefaultstackptr -> getcard() -> message(MCM_suspend);
103105
MCappisactive = False;
104106
}
105107

106108
void MCPlatformHandleApplicationResume(void)
107109
{
108-
MCappisactive = True;
109-
MCdefaultstackptr -> getcard() -> message(MCM_resume);
110+
// FG-2014-09-22: [[ Bugfix 13480 ]] May have no default stack on startup
111+
MCappisactive = True;
112+
if (MCdefaultstackptr)
113+
MCdefaultstackptr -> getcard() -> message(MCM_resume);
110114
}
111115

112116
void MCPlatformHandleApplicationRun(bool& r_continue)

0 commit comments

Comments
 (0)