Issue viewing time logs on non-started sprint

Issue #3 resolved
Zachary Griggs created an issue

When trying to view the data of a sprint that has been not started, I get the following error:

#!

TypeError: Cannot read property 'substring' of undefined
    at C:\Users\griggszm\Desktop\Labs\SDL\abouttime\index.js:142:26
    at Layer.handle [as handle_request] (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\index.js:275:10)
    at serveStatic (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\serve-static\index.js:75:16)
    at Layer.handle [as handle_request] (C:\Users\griggszm\Desktop\Labs\SDL\abouttime\node_modules\express\lib\router\layer.js:95:5)

This is different from the bug in viewing time when no time has been logged. This line causes the issue:

start = startdate.substring(0,10);

Because there is no start date yet, it errors. A solution might be to check that start/end dates are not undefined in the /timeresultsForSprint method and letting it display an error. It might make more sense, though, to not even display sprints that have not been started.

The same issue happens if you quickly press submit before the sprint list loads.

Comments (4)

  1. Log in to comment