game crashes "null object reference" when stopping music on save data condition #2612
Replies: 2 comments 7 replies
-
Converted to a discussion, since this seems like a logic issue with your code. If a flixel issue is discovered we need to find out the specific cause before making an issue What line is crashing? It should tell you, especially if you add Also I notice you have the following if (FlxG.save.data.music == true)
{}
else if (FlxG.save.data.music = = true)
|
Beta Was this translation helpful? Give feedback.
-
so your saying the condition should be if (FlxG.sound.music != null) then FlxG.sound.music.stop(); ? |
Beta Was this translation helpful? Give feedback.
-
Code snippet reproducing the issue:
Observed behavior:on the save data condition, the false statement stops the music when no music detected
Expected behavior:crashes with message "null object reference"
Beta Was this translation helpful? Give feedback.
All reactions