abe33/atom-color-highlight

Uncaught TypeError: Cannot read property 'getScreenRange' of null

Closed this issue · 11 comments

Uncaught TypeError: Cannot read property 'getScreenRange' of null

Atom Version: 0.160.0
System: Mac OS X 10.10
Thrown From: atom-color-highlight package, v2.0.14

Steps To Reproduce

  1. ...
  2. ...

Stack Trace

At /Users/ikyu/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:71

TypeError: Cannot read property 'getScreenRange' of null
  at MarkerView.module.exports.MarkerMixin.getScreenRange (/Users/ikyu/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:71:29)
  at AtomColorHighlightView.module.exports.AtomColorHighlightView.updateSelections (/Users/ikyu/.atom/packages/atom-color-highlight/lib/atom-color-highlight-view.coffee:89:26)
  at AtomColorHighlightView.updateSelections (/Users/ikyu/.atom/packages/atom-color-highlight/lib/atom-color-highlight-view.coffee:1:1)
  at /Users/ikyu/.atom/packages/atom-color-highlight/lib/atom-color-highlight-view.coffee:75:8

/cc @atom/core

To easily reproduce this split the pane. (This is when it happened to me.)

👍 on windows 8.1

my stack trace:

TypeError: Cannot read property 'getScreenRange' of null
  at color-marker.module.exports.MarkerMixin.getScreenRange (c:\Users\Sean\.atom\packages\atom-color-highlight\lib\marker-mixin.coffee:79:29)
  at atom-color-highlight.AtomColorHighlightElement.updateSelections (c:\Users\Sean\.atom\packages\atom-color-highlight\lib\atom-color-highlight-element.coffee:74:26)
  at c:\Users\Sean\.atom\packages\atom-color-highlight\lib\atom-color-highlight-element.coffee:59:8

You are 15 minor versions behind on Atom and 1 major version behind on the atom-color-highlight package. I suggest you update these first and then report again if you still have the errors.

@abe33 Uhm, just because the OP was doesn't mean the rest of us are. I am always on the latest stable and latest of every plugin and it's still an ongoing issue.

@envygeeks Sorry I'll reopen it then. A lot of things have changed in the ~20 last Atom version and I'm a a bit frustrated by the dozens of duplicate issues on minimap, most of the time the issue being that they didn't have updated the plugin or Atom since ages. And as I can't make every changes backward compatible without carrying a shitload of crappy code I'm quick at closing these kinds of issues.

To come back to the topic, I'll need some more details, does the error occurs on every pane split or just when there's colors highlighted in the buffer?

It's perfectly fine! btw, I got this error again this morning when copying and pasting and then suddenly doing a CTRL+Z but most of the time I do get it when I have multiple panes open.

@abe33 This error occurs for me when there isn't colour highlighted in the buffer.

Package version: 3.0.6
Atom version: 0.177.0

I stand corrected, memory addresses (0xdeadbeef etc.) were being highlighted.

I just published a patch with a guard when accessing the marker range. I'm not sure what trigger this issue but I hope this patch will at least prevent errors to be raised. Let me know if it fixed things for you.

Great news, I'll keep an eye out for it 😄

I'm afraid it has just reared its ugly head again…

TypeError: Cannot read property 'getScreenRange' of null
  at color-marker.module.exports.MarkerMixin.getScreenRange (/Users/mwuk/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:6:3)
  at atom-color-highlight.AtomColorHighlightElement.updateSelections (/Users/mwuk/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:74:26)
  at /Users/mwuk/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:59:8

Split pane view again 😨