cloudspokes / arena-web

Web arena for SRMs
44 stars 32 forks source link

parseDate from Bundle.js somehow gets undefined instead of a string. #1098

Closed Goodwine closed 9 years ago

Goodwine commented 9 years ago

When running the following function in bundle.js [1], on success, the data has a bunch of "contest" objects, and one of them [2] has an empty startDate. And it throws the following stacktrace [3]

[1]

$http.get(config.apiDomain + '/data/srm/schedule?pageIndex=-1&sortColumn=startDate&sortOrder=asc').success(function (data, status, headers) {

[2]

{
    "roundId": 13665,
    "contestId": 12908,
    "contestName": "TCHS SRM 60 DIV 1",
    "roundType": "Single Round Match",
    "registrationStartTime": "2008-10-28T23:17:00.000-0400",
    "registrationEndTime": "2008-10-28T23:17:00.000-0400",
    "codingStartTime": "2008-10-28T23:17:00.000-0400",
    "codingEndTime": "2008-10-28T23:17:00.000-0400",
    "intermissionStartTime": "2008-10-28T23:17:00.000-0400",
    "intermissionEndTime": "2008-10-28T23:17:00.000-0400",
    "challengeStartTime": "2008-10-28T23:17:00.000-0400",
    "challengeEndTime": "2008-10-28T23:17:00.000-0400"
}

[3]

TypeError: Cannot read property 'substring' of undefined
    at parseDate (https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:6729:37)
    at https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:6769:28
    at Array.forEach (native)
    at https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:6766:23
    at https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:32973:11
    at wrappedCallback (https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:36433:81)
    at wrappedCallback (https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:36433:81)
    at https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:36519:26
    at Scope.$eval (https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:37562:28)
    at Scope.$digest (https://d2l7b0usk48cxd.cloudfront.net/arena/prod/web-v2014.10.27.7/js/bundle.js:37374:31)bundle.js:34932 (anonymous function)
Goodwine commented 9 years ago

Additionally, there are 12 "contest objects" that are missing the following keys:

mdesiderio commented 9 years ago

This issue was moved to appirio-tech/arena-web#9