summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-10-31 09:54:11 +0100
committerGitHub <noreply@github.com>2018-10-31 09:54:11 +0100
commit16f066c8f18b1231e88e950233a0fad0993ed434 (patch)
treef5f335a7bea60c25f845fe11adecc3802c80920b
parentad22ef28a9f07686ab6be811086f986af038f7ed (diff)
parenta069685fbb60503a64765c39079958dcbe67a400 (diff)
Merge pull request #23393 from marcelofg55/osx_crash
Fix OS X crash when running as .app
-rw-r--r--platform/osx/os_osx.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index e18a7d482c..b84e22f53c 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -331,7 +331,8 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto
get_mouse_pos(
[OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream],
[OS_OSX::singleton->window_view backingScaleFactor]);
- OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y));
+ if (OS_OSX::singleton->input)
+ OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y));
if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);