diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index c18eb5e5ce..ded466079e 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -568,16 +568,6 @@ int Search_Devices() int numjoy = SDL_NumJoysticks(); - if (numjoy == 0) - { - #ifdef _WIN32 - MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING); - #else - printf("No Joystick detected!\n"); - #endif - return 0; - } - if (joyinfo) { delete [] joyinfo; @@ -588,6 +578,16 @@ int Search_Devices() joyinfo = new CONTROLLER_INFO [numjoy]; } + if (numjoy == 0) + { + #ifdef _WIN32 + MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING); + #else + printf("No Joystick detected!\n"); + #endif + return 0; + } + #ifdef _DEBUG fprintf(pFile, "Scanning for devices\n"); fprintf(pFile, "ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\n");