Skip to content

Fix NPE in JmeAndroidSystem when audio renderer is disabled#2670

Merged
riccardobl merged 2 commits intomasterfrom
copilot/fix-null-audio-renderers-check
Apr 3, 2026
Merged

Fix NPE in JmeAndroidSystem when audio renderer is disabled#2670
riccardobl merged 2 commits intomasterfrom
copilot/fix-null-audio-renderers-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

JmeAndroidSystem.newContext() called .equals() directly on settings.getAudioRenderer() without a null guard, crashing with a NullPointerException when users called settings.setAudioRenderer(null) to disable audio — a pattern explicitly supported on desktop.

Changes

  • newContext(): Added null check at the head of the audio renderer comparison chain; sets audioRendererType = null when audio is disabled
  • newAudioRenderer(): Returns null when settings.getAudioRenderer() == null, consistent with JmeDesktopSystem behavior
// Previously crashed here with NPE when audioRenderer is null
settings.setAudioRenderer(null);
app.start(); // now works; audio is simply disabled

Copilot AI changed the title [WIP] Fix null audio renderers check in AndroidSystem Fix NPE in JmeAndroidSystem when audio renderer is disabled Apr 2, 2026
Copilot AI requested a review from riccardobl April 2, 2026 13:06
@riccardobl riccardobl marked this pull request as ready for review April 2, 2026 13:12
@riccardobl riccardobl merged commit 994c552 into master Apr 3, 2026
17 checks passed
@stephengold stephengold deleted the copilot/fix-null-audio-renderers-check branch April 4, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AndroidSystem delegate doesn't check for null audio renderers

2 participants