mikaeljorhult / brackets-todo

Brackets/Edge Code extension that displays all TODO comments in current document or project.
144 stars 37 forks source link

Safeguard for missing todos #149

Closed petetnt closed 7 years ago

petetnt commented 7 years ago

https://github.com/mikaeljorhult/brackets-todo/blob/master/modules/Files.js#L65 was throwing for me for some reason with

Files.js:65 Uncaught TypeError: Cannot read property 'length' of undefined

This PR adds a simple safeguard for files.todos actually existing before trying to look up its length.

mikaeljorhult commented 7 years ago

Thank you!

That's should always be a empty array if no comments are found but I must have messed it up somewhere. I'll do some digging to fix the underlying issue as well.

petetnt commented 7 years ago

Yep, it might have been something funky going on with my machine too, but at least the safeguard wouldn't hurt anyone 👍