Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rare crash when missile explodes before audioRender() has been called #407

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

agateau
Copy link
Owner

@agateau agateau commented Sep 27, 2023

This has been reported by Google Play review system as a crash in Missile.explode(), caused by mSoundPlayer being null:

Exception java.lang.NullPointerException: Attempt to invoke interface method 'void com.agateau.pixelwheels.sound.SoundPlayer.stop()' on a null object reference
  at com.agateau.pixelwheels.bonus.Missile.explode (Missile.java:343)
  at com.agateau.pixelwheels.bonus.Missile.preSolve (Missile.java:368)
  at com.agateau.pixelwheels.racescreen.GameWorldImpl.preSolve (GameWorldImpl.java:374)
  at com.badlogic.gdx.physics.box2d.World.preSolve (World.java:1003)
  at com.badlogic.gdx.physics.box2d.World.jniStep
  at com.badlogic.gdx.physics.box2d.World.step (World.java:691)
  at com.agateau.pixelwheels.racescreen.GameWorldImpl.act (GameWorldImpl.java:193)
  at com.agateau.pixelwheels.racescreen.RaceScreen.render (RaceScreen.java:218)
  at com.badlogic.gdx.Game.render (Game.java:46)
  at com.agateau.pixelwheels.PwGame.render (PwGame.java:179)
  at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame (AndroidGraphics.java:471)
  at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1573)
  at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1272)

…lled

This has been reported by Google Play review system as a crash in
Missile.explode(), caused by mSoundPlayer being null:

Exception java.lang.NullPointerException: Attempt to invoke interface method 'void com.agateau.pixelwheels.sound.SoundPlayer.stop()' on a null object reference
  at com.agateau.pixelwheels.bonus.Missile.explode (Missile.java:343)
  at com.agateau.pixelwheels.bonus.Missile.preSolve (Missile.java:368)
  at com.agateau.pixelwheels.racescreen.GameWorldImpl.preSolve (GameWorldImpl.java:374)
  at com.badlogic.gdx.physics.box2d.World.preSolve (World.java:1003)
  at com.badlogic.gdx.physics.box2d.World.jniStep
  at com.badlogic.gdx.physics.box2d.World.step (World.java:691)
  at com.agateau.pixelwheels.racescreen.GameWorldImpl.act (GameWorldImpl.java:193)
  at com.agateau.pixelwheels.racescreen.RaceScreen.render (RaceScreen.java:218)
  at com.badlogic.gdx.Game.render (Game.java:46)
  at com.agateau.pixelwheels.PwGame.render (PwGame.java:179)
  at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame (AndroidGraphics.java:471)
  at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1573)
  at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1272)
@agateau agateau added the skip-changelog Used on PR to indicate changes which do not require a changelog entry label Sep 27, 2023
@agateau agateau merged commit 16d301c into master Sep 27, 2023
4 of 5 checks passed
@agateau agateau deleted the fix-crash-with-missile-sound branch September 27, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Used on PR to indicate changes which do not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant