diff --git a/js/wii.js b/js/wii.js index ffa3d7b..8e53ede 100644 --- a/js/wii.js +++ b/js/wii.js @@ -106,7 +106,7 @@ Wii.listen = function() { } else { for(var evt in wii_remote.evtsInterestedIn) { var evtHappened = Wii.DISPATCHER[evt](wii_remote, wii_remoteCurrStatus); - if(evtHappened) try { wii_remote.evtsInterestedIn[evt](wii_remote, wii_remoteCurrStatus); } catch(e) { alert(e.message); } + if(evtHappened) wii_remote.evtsInterestedIn[evt](wii_remote, wii_remoteCurrStatus); } } } @@ -156,7 +156,8 @@ Wii.parsePrimaryWiimote = function(e) { * matchups; this gets messy pretty quickly... */ if(typeof buttonPressed !== 'undefined' && typeof wii_remote.evtsInterestedIn[buttonPressed] === 'function') { - wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus); + try { wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus); + } catch(e) { alert(e.message); } } /* Doing this in conjunction with preventDefault() halts an odd clicking bug or two. */