kisstkondoros / codemetrics

VSCode extension which shows the complexity information for TypeScript class members
Other
402 stars 20 forks source link

Cannot read property 'document' of undefined #27

Closed jrieken closed 7 years ago

jrieken commented 7 years ago

I see this error a lot in production and when developing extensions it makes the debugger always break there...

Cannot read property 'document' of undefined: TypeError: Cannot read property 'document' of undefined
    at Timeout._onTimeout (/Users/jrieken/.vscode-insiders/extensions/kisstkondoros.vscode-codemetrics-1.7.0/out/editordecoration/EditorDecoration.js:40:59)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)
screen shot 2017-05-30 at 15 44 53
kisstkondoros commented 7 years ago

Hi,

Thanks for reporting the bug! Now the change callbacks are using vscode.window.activeTextEditor (and some null checks) to avoid this issue, however I can't think of a case where this could happen.

Hopefully this will fix the problem for you, but it is still interesting!