TylerJDev / YouTube-Timestamps

A plugin which tracks YouTube timestamps. Never lose track of what timestamp you're on again! ⏱️
6 stars 1 forks source link

Plugin throws error before first timestamp #2

Closed TylerJDev closed 5 years ago

TylerJDev commented 5 years ago

Occurrences

Steps to reproduce

  1. Open Chrome Developer Tools
  2. Proceed to one of the URLs above
  3. Ensure that the video is playing from the start

Expected Result No error should be thrown within the console

Actual Result Error handleYoutube.js:67 Uncaught TypeError: Cannot read property '0' of undefined is thrown in the console

Comments This is most likely caused because the first timestamp link in the URLs mentioned start after 00:00, i.e, (00:04). Will need to ensure that no error is thrown if the first timestamp link starts after 00:00.

TylerJDev commented 5 years ago

Issue fixed. Added an if statement to ensure current timestamp is valid (i.e, has items within array). Should no longer throw an error.