Prevent null point exception in preloadBackgroundMusic

This commit is contained in:
Augusto Souza 2011-08-28 00:59:51 -03:00
parent 3a0c2cb4fb
commit 32f8060c49
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ public class Cocos2dxMusic {
}
public void preloadBackgroundMusic(String path){
if (! mCurrentPath.equals(path)){
if ((mCurrentPath == null) || (! mCurrentPath.equals(path))){
// preload new background music
// release old resource and create a new one