mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-11 08:32:41 +01:00
DroidFish: Avoid NPE if creating a MediaPlayer object fails.
This commit is contained in:
@@ -2938,7 +2938,8 @@ 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);
|
||||||
moveSound.start();
|
if (moveSound != null)
|
||||||
|
moveSound.start();
|
||||||
}
|
}
|
||||||
if (vibrateEnabled) {
|
if (vibrateEnabled) {
|
||||||
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
|||||||
Reference in New Issue
Block a user