DroidFish: Avoid NPE if creating a MediaPlayer object fails.

This commit is contained in:
Peter Osterlund
2013-02-15 17:22:44 +00:00
parent eefda143b5
commit f05e0fe48a

View File

@@ -2938,6 +2938,7 @@ public class DroidFish extends Activity implements GUIInterface {
if (moveSound != null) if (moveSound != null)
moveSound.release(); moveSound.release();
moveSound = MediaPlayer.create(this, R.raw.movesound); moveSound = MediaPlayer.create(this, R.raw.movesound);
if (moveSound != null)
moveSound.start(); moveSound.start();
} }
if (vibrateEnabled) { if (vibrateEnabled) {