Qt: Fix crash when initializing gamepads
Jeffrey Pfau jeffrey@endrift.com
Sun, 22 Mar 2015 13:03:14 -0700
1 files changed,
2 insertions(+),
1 deletions(-)
M
src/platform/qt/InputController.cpp
→
src/platform/qt/InputController.cpp
@@ -27,6 +27,7 @@ : QObject(parent)
, m_playerId(playerId) , m_config(nullptr) , m_gamepadTimer(nullptr) + , m_playerAttached(false) { GBAInputMapInit(&m_inputMap);@@ -102,7 +103,7 @@
const char* InputController::profileForType(uint32_t type) { UNUSED(type); #ifdef BUILD_SDL - if (type == SDL_BINDING_BUTTON) { + if (type == SDL_BINDING_BUTTON && m_sdlPlayer.joystick) { #if SDL_VERSION_ATLEAST(2, 0, 0) return SDL_JoystickName(m_sdlPlayer.joystick); #else