static analysis: Fixed several complaints from codechecker.

There are still some pending Objective-C specific issues.

Reference issue #4600.
This commit is contained in:
Ryan C. Gordon 2022-03-24 11:00:43 -04:00
parent eadc064e2c
commit 4fe7b2cbd1
No known key found for this signature in database
GPG key ID: FA148B892AB48044
10 changed files with 33 additions and 20 deletions

View file

@ -1590,11 +1590,13 @@ SDL_JoystickUpdate(void)
for (joystick = SDL_joysticks; joystick; joystick = joystick->next) {
if (joystick->attached) {
/* This should always be true, but seeing a crash in the wild...? */
if (joystick->driver) {
joystick->driver->Update(joystick);
/* This driver should always be != NULL, but seeing a crash in the wild...? */
if (!joystick->driver) {
continue; /* nothing we can do, and other things use joystick->driver below here. */
}
joystick->driver->Update(joystick);
if (joystick->delayed_guide_button) {
SDL_GameControllerHandleDelayedGuideButton(joystick);
}