benbria / coffee-coverage

Istanbul and JSCoverage-style instrumentation for CoffeeScript files.
MIT License
145 stars 31 forks source link

null pointer error #54

Closed nevercast closed 9 years ago

nevercast commented 9 years ago

Hello, odd bug here:

sourceStat.isDirectory() @ https://github.com/benbria/coffee-coverage/blob/master/src/coffeeCoverage.coffee#L193 leads to TypeError: Cannot read property 'isDirectory' of null

In some odd and not solidly reproducible cases where a ls returns a directory that doesn't actually exist (exists returns true but stat returns null) I've noticed this when using Atom editor also. I'm running Windows and node 0.12.

It's a very rare edge-case but maybe a quick null check?

Noticed it with the current version of Coffee-Coverage 0.6.2

jwalton commented 9 years ago

Will release a new version shortly.

jwalton commented 9 years ago

Actually, if you could have a quick read over my changes and make sure I didn't make any obvious mistakes, that would be awesome. One of these days I need to write unit tests for all the command-line compile cases, but we use run-time instrumentation, so it's always kind of one of those items that never gets any attention. :)

nevercast commented 9 years ago

Thanks for the fixes! I'll check it over this afternoon. :)

naxmefy commented 9 years ago

when do you upload the fix to npm (version 0.6.3 <_<)

jwalton commented 9 years ago

Was hoping for a confirm from @nevercast, but I can release it now. :)

jwalton commented 9 years ago

Released as 0.6.3.

nevercast commented 9 years ago

Ugh. Sorry about that. I forget that I comment on things and don't check back and do as promised. I need a way to keep a task list for Github!

jwalton commented 9 years ago

I know. If I had time, I'd write a service that keeps track of all the prs and issues on all my github projects, and all the things I've commented on. :P

-Jason On Aug 12, 2015 19:03, "Josh Lloyd" notifications@github.com wrote:

Ugh. Sorry about that. I forget that I comment on things and don't check back and do as promised. I need a way to keep a task list for Github!

— Reply to this email directly or view it on GitHub https://github.com/benbria/coffee-coverage/issues/54#issuecomment-130472779 .

nevercast commented 9 years ago

After some further testing, stat fails when there is no access to the directory (Permission Denied). That was likely the cause. With that said this should be fixed by the same fix.

@jwalton IFTTT perhaps!