Skip to content
Snippets Groups Projects
Commit 21d1ff1f authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

[#60] add null check for window

parent 86525730
Branches
Tags
1 merge request!65Resolve "Kamera - Steuerung mittels Controller"
Pipeline #25863 passed
...@@ -20,6 +20,7 @@ namespace vkcv::camera { ...@@ -20,6 +20,7 @@ namespace vkcv::camera {
m_window.e_mouseScroll.remove(m_mouseScrollHandle); m_window.e_mouseScroll.remove(m_mouseScrollHandle);
m_window.e_mouseButton.remove(m_mouseButtonHandle); m_window.e_mouseButton.remove(m_mouseButtonHandle);
m_window.e_resize.remove(m_resizeHandle); m_window.e_resize.remove(m_resizeHandle);
m_window.e_gamepad.remove(m_gamepadHandle);
} }
void CameraManager::bindCameraToEvents() { void CameraManager::bindCameraToEvents() {
......
...@@ -119,7 +119,8 @@ namespace vkcv { ...@@ -119,7 +119,8 @@ namespace vkcv {
void Window::onGamepadEvent(int gamepadIndex) { void Window::onGamepadEvent(int gamepadIndex) {
auto window = static_cast<Window *>(glfwGetJoystickUserPointer(gamepadIndex)); auto window = static_cast<Window *>(glfwGetJoystickUserPointer(gamepadIndex));
if (glfwJoystickPresent(gamepadIndex)) {
if ( window != nullptr && glfwJoystickPresent(gamepadIndex)) {
window->e_gamepad(gamepadIndex); window->e_gamepad(gamepadIndex);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment