diff --git a/_javascript/curriculum.js b/_javascript/curriculum.js index e121e42f6..579675638 100644 --- a/_javascript/curriculum.js +++ b/_javascript/curriculum.js @@ -11,10 +11,14 @@ $(function(){ // Parse username from querystring var urlSearch = window.location.search, - teacherQuery = urlSearch.match(/teacher=[a-z,A-Z,0-9]*/)[0], - username = teacherQuery.substring(8, teacherQuery.length); + teacherQuery = urlSearch.match(/teacher=[a-z,A-Z,0-9]*/), + username; + + if(teacherQuery && teacherQuery.length == 1){ + username = teacherQuery[0].substring(8, teacherQuery[0].length); + + console.log(username); - if(username){ $.ajax( { url: "https://api.github.com/users/"+username,