forked from Clones/Controlify
🐛 Fix crash when discovering controllers without SDL
This commit is contained in:
@ -434,6 +434,7 @@ public class Controlify implements ControlifyApi {
|
|||||||
Log.LOGGER.error("GLFW failed to load gamepad mappings!");
|
Log.LOGGER.error("GLFW failed to load gamepad mappings!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SDL2NativesManager.isLoaded()) {
|
||||||
try (Memory memory = new Memory(bytes.length)) {
|
try (Memory memory = new Memory(bytes.length)) {
|
||||||
memory.write(0, bytes, 0, bytes.length);
|
memory.write(0, bytes, 0, bytes.length);
|
||||||
SDL_RWops rw = SDL_RWFromConstMem(memory, (int) memory.size());
|
SDL_RWops rw = SDL_RWFromConstMem(memory, (int) memory.size());
|
||||||
@ -442,7 +443,8 @@ public class Controlify implements ControlifyApi {
|
|||||||
Log.LOGGER.error("SDL2 failed to load gamepad mappings!");
|
Log.LOGGER.error("SDL2 failed to load gamepad mappings!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
Log.LOGGER.error("Failed to load gamecontrollerdb.txt", e);
|
Log.LOGGER.error("Failed to load gamecontrollerdb.txt", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user