Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 7362c77

Browse files
author
Nick Litwin
committed
Handle the case where no challenges appear
1 parent f498d60 commit 7362c77

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/submissions/submissions.routes.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@
3333

3434
return ChallengeService.getUserChallenges(userHandle, params)
3535
.then(function(challenge) {
36-
console.log('Challenge???? ', challenge.plain())
3736
challenge = challenge[0];
3837

38+
if (!challenge) {
39+
// There should be a challenge, redirect?
40+
alert('User is not associated with this challenge.');
41+
}
42+
3943
var isPhaseSubmission = _.some(challenge.currentPhases, {
4044
phaseStatus: 'Open',
4145
phaseType: 'Submission'

0 commit comments

Comments
 (0)