Skip to content

Commit

Permalink
Check for possible null reference in Sfx
Browse files Browse the repository at this point in the history
  • Loading branch information
Draknek committed Mar 28, 2011
1 parent 957b6fa commit 7a182c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/flashpunk/Sfx.as
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
_vol = _transform.volume = vol < 0 ? 0 : vol; _vol = _transform.volume = vol < 0 ? 0 : vol;
_pan = _transform.pan = pan < -1 ? -1 : (pan > 1 ? 1 : pan); _pan = _transform.pan = pan < -1 ? -1 : (pan > 1 ? 1 : pan);
_channel = _sound.play(0, 0, _transform); _channel = _sound.play(0, 0, _transform);
_channel.addEventListener(Event.SOUND_COMPLETE, onComplete); if (_channel) _channel.addEventListener(Event.SOUND_COMPLETE, onComplete);
_looping = false; _looping = false;
_position = 0; _position = 0;
} }
Expand Down Expand Up @@ -80,7 +80,7 @@
public function resume():void public function resume():void
{ {
_channel = _sound.play(_position, 0, _transform); _channel = _sound.play(_position, 0, _transform);
_channel.addEventListener(Event.SOUND_COMPLETE, onComplete); if (_channel) _channel.addEventListener(Event.SOUND_COMPLETE, onComplete);
_position = 0; _position = 0;
} }


Expand Down

0 comments on commit 7a182c9

Please sign in to comment.