From 5e8ef7057ce8d668405da08a6980791d2950737a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=A4=AA?= Date: Thu, 3 Apr 2014 16:52:35 +1100 Subject: [PATCH] Fix crash when accepting/cancelling tournament challenges before a tournament has started --- tournaments/frontend.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tournaments/frontend.js b/tournaments/frontend.js index ed37d081d4..0e327fac39 100644 --- a/tournaments/frontend.js +++ b/tournaments/frontend.js @@ -455,7 +455,7 @@ var Tournament = (function () { this.isBracketInvalidated = true; this.update(); }; - Tournament.prototype.cancelChallenge = function (user) { + Tournament.prototype.cancelChallenge = function (user, output) { if (!this.isTournamentStarted) { output.sendReply('|tournament|error|NotStarted'); return; @@ -476,7 +476,7 @@ var Tournament = (function () { this.isAvailableMatchesInvalidated = true; this.update(); }; - Tournament.prototype.acceptChallenge = function (user) { + Tournament.prototype.acceptChallenge = function (user, output) { if (!this.isTournamentStarted) { output.sendReply('|tournament|error|NotStarted'); return; @@ -590,10 +590,10 @@ var commands = { tournament.challenge(user, targetUser, this); }, cancelchallenge: function (tournament, user) { - tournament.cancelChallenge(user); + tournament.cancelChallenge(user, this); }, acceptchallenge: function (tournament, user) { - tournament.acceptChallenge(user); + tournament.acceptChallenge(user, this); } }, creation: {