Skip to content

io: Fix crash on SDL joystick disconnect#7216

Merged
wookieejedi merged 1 commit intoscp-fs2open:masterfrom
laanwj:2026-sdl-js-fix
Feb 20, 2026
Merged

io: Fix crash on SDL joystick disconnect#7216
wookieejedi merged 1 commit intoscp-fs2open:masterfrom
laanwj:2026-sdl-js-fix

Conversation

@laanwj
Copy link
Contributor

@laanwj laanwj commented Feb 11, 2026

Fix a crash on joystick disconnection by checking that pJoystick[i] is non-null before dereferencing it.

(im running into this regularly while disconnecting the session in moonlight/sunshine, which removes a bunch of virtual libevent devices)

Check that `pJoystick[i]` is non-null before dereferencing it.
@wookieejedi wookieejedi added fix A fix for bugs, not-a-bugs, and/or regressions. controls A feature or issue related to input devices or actions controlled/triggered by them labels Feb 11, 2026
@wookieejedi wookieejedi added this to the Release 25.0.1 milestone Feb 11, 2026
Copy link
Member

@wookieejedi wookieejedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple fix!

@wookieejedi
Copy link
Member

Even though it is a 1-line fix, it would be good to have @z64555 take a look, too.

@wookieejedi
Copy link
Member

Okay given the time I'll merge this

@wookieejedi wookieejedi merged commit 239e027 into scp-fs2open:master Feb 20, 2026
20 checks passed
@wookieejedi wookieejedi added the Point Release Candidate An already merged bugfix that may be merged into a previous stable version label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls A feature or issue related to input devices or actions controlled/triggered by them fix A fix for bugs, not-a-bugs, and/or regressions. Point Release Candidate An already merged bugfix that may be merged into a previous stable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants