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,7 +2938,8 @@ public class DroidFish extends Activity implements GUIInterface {
if (moveSound != null)
moveSound.release();
moveSound = MediaPlayer.create(this, R.raw.movesound);
moveSound.start();
if (moveSound != null)
moveSound.start();
}
if (vibrateEnabled) {
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);