dev-jjjjjeong-bin / Invaders-SDP

3 stars 15 forks source link

[BUG] (Sound Team) Sound issue causes the game to freeze. #84

Closed AaykeN closed 5 days ago

AaykeN commented 1 week ago

Problem Description

While playing the game, it occasionally crashes with the following error:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.Map.values()" because "Sound_Operator.SoundManager.BGMs" is null at Sound_Operator.SoundManager.stopAllBGM(SoundManager.java:84) at engine.Core.main(Core.java:215)

image

Steps to Reproduce

  1. Start the game and play through a few rounds.
  2. Wait for a random amount of time; the crash does not seem tied to specific actions but happens intermittently.
  3. Observe if the game crashes with the NullPointerException error.

Additional Information

This crash tends to occur at the end of a round when background music may be stopping or transitioning.

Kang-Minseokk commented 6 days ago

I'll check it. Thank you for identifying the bug!

Kang-Minseokk commented 6 days ago

After reviewing the error, we identified that the issue occurs when the WAV file used for BGM is repeatedly requested to play within a very short interval. We have modified the Sound Operator team's code to ensure that the stop method only executes if the object exists.

스크린샷 2024-10-15 오후 8 57 50

If the same error occurs again, please let us know!