Qt: Fix crash when initializing gamepads

This commit is contained in:
Jeffrey Pfau 2015-03-22 13:03:14 -07:00
parent 291d5c500b
commit 302b041507
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ InputController::InputController(int playerId, QObject* parent)
, m_playerId(playerId)
, m_config(nullptr)
, m_gamepadTimer(nullptr)
, m_playerAttached(false)
{
GBAInputMapInit(&m_inputMap);
@ -102,7 +103,7 @@ void InputController::saveProfile(uint32_t type, const QString& profile) {
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