mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 19:34:08 +01:00
DroidFish: Avoid NPE if creating a MediaPlayer object fails.
This commit is contained in:
parent
eefda143b5
commit
f05e0fe48a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user