Help with "cannot read property '1' of null" error

Help with "cannot read property '1' of null" error
0

Hello!
I had issues with my JQuery Pomodoro Clock so I remade it using React (my first React project so bear with me). I’m getting a (cannot read property ‘1’ of null) error on tests #12, #13, and #14 and I don’t know what it means. Can anyone tell me what the test suite is doing when it hits that error?

I like to think I’m decent at debugging but it’s hard to do when I don’t understand the error itself.
Thanks,
-J

https://codepen.io/JesseHope/pen/GVxaay?editors=1010

I notice that when your timer reaches 00:00 it does not change to Break or Session until one second later.

1 Like

The issue is that when I switched between “Break” and “Session”, I didn’t add the leading “0” to the minutes if the length of minutes was less than 10. I assume that the “cannot read property ‘1’ of null” is in regards to the actual minutes in “time-left” being displayed as m:ss as opposed to mm:ss. Really easy to fix but I had to go through trial and error as the error didn’t point me in the right direction. Hopefully this can help campers in the future who are confused about that error.
-J