Skip to content

Commit

Permalink
Added null checking of mMyTrack and handling of NullPointerException …
Browse files Browse the repository at this point in the history
…in StopThread() of PlayerThread.java.
  • Loading branch information
forteri76 committed May 2, 2014
1 parent 56d4622 commit 5850fb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/com/peculiargames/andmodplug/PlayerThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,13 @@ public void StopThread() {
* track, but seem to get an uninitialized audio track here
* occasionally, generating an IllegalStateException.
*/
try {
if (mMytrack != null) try {
if (mMytrack.getState() == AudioTrack.STATE_INITIALIZED)
mMytrack.stop();
} catch (IllegalStateException ise) {
} catch (NullPointerException npe) {
npe.printStackTrace();
}
catch (IllegalStateException ise) {
ise.printStackTrace();
}

Expand Down
1 change: 0 additions & 1 deletion src/org/jfedor/frozenbubble/FrozenBubble.java
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,6 @@ private void restoreGamePrefs() {
targetMode = mConfig.getInt ("targetMode", POINT_TO_SHOOT );

BubbleSprite.setCollisionThreshold(collision);
setTargetMode(targetMode);
setTargetModeOrientation();
}

Expand Down

0 comments on commit 5850fb6

Please sign in to comment.