From a069685fbb60503a64765c39079958dcbe67a400 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Mon, 29 Oct 2018 21:50:41 -0300 Subject: [PATCH] Fix OS X crash when running as .app --- platform/osx/os_osx.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index e18a7d482ca..b84e22f53c4 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);