coopermaruyama/apathy-theme

Uncaught TypeError: Cannot read property 'textContent' of null

Closed this issue · 1 comments

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.19
System: Ubuntu 14.04.3
Thrown From: apathy-theme package, v1.7.3

Stack Trace

Uncaught TypeError: Cannot read property 'textContent' of null

At /opt/atom/resources/app.asar/src/lines-tile-component.js:428

TypeError: Cannot read property 'textContent' of null
  at LinesTileComponent.module.exports.LinesTileComponent.measureCharactersInLine (/opt/atom/resources/app.asar/src/lines-tile-component.js:428:40)
  at LinesTileComponent.module.exports.LinesTileComponent.measureCharactersInNewLines (/opt/atom/resources/app.asar/src/lines-tile-component.js:395:16)
  at /opt/atom/resources/app.asar/src/lines-component.js:135:23
  at DisplayBuffer.module.exports.DisplayBuffer.batchCharacterMeasurement (/opt/atom/resources/app.asar/src/display-buffer.js:571:7)
  at TextEditor.module.exports.TextEditor.batchCharacterMeasurement (/opt/atom/resources/app.asar/src/text-editor.js:2819:33)
  at TextEditorPresenter.module.exports.TextEditorPresenter.batchCharacterMeasurement (/opt/atom/resources/app.asar/src/text-editor-presenter.js:1318:18)
  at LinesComponent.module.exports.LinesComponent.measureCharactersInNewLines (/opt/atom/resources/app.asar/src/lines-component.js:129:29)
  at LinesComponent.module.exports.LinesComponent.remeasureCharacterWidths (/opt/atom/resources/app.asar/src/lines-component.js:125:19)
  at /home/sunderhus/.atom/packages/apathy-theme/lib/apathy-view.coffee:417:47
  at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.cursorMoved (/opt/atom/resources/app.asar/src/text-editor.js:1599:27)
  at Selection.module.exports.Selection.markerDidChange (/opt/atom/resources/app.asar/src/selection.js:913:21)
  at /opt/atom/resources/app.asar/src/selection.js:43:24
  at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Marker.module.exports.Marker.notifyObservers (/opt/atom/resources/app.asar/src/marker.js:270:27)
  at /opt/atom/resources/app.asar/src/marker.js:65:26
  at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Marker.module.exports.Marker.emitChangeEvent (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/marker.js:401:20)
  at Marker.module.exports.Marker.update (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/marker.js:346:12)
  at Marker.module.exports.Marker.setHeadPosition (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/marker.js:143:19)
  at Marker.module.exports.Marker.setHeadBufferPosition (/opt/atom/resources/app.asar/src/marker.js:175:32)
  at Marker.module.exports.Marker.setHeadScreenPosition (/opt/atom/resources/app.asar/src/marker.js:185:19)
  at /opt/atom/resources/app.asar/src/cursor.js:84:31
  at Cursor.module.exports.Cursor.changePosition (/opt/atom/resources/app.asar/src/cursor.js:696:7)
  at Cursor.module.exports.Cursor.setScreenPosition (/opt/atom/resources/app.asar/src/cursor.js:82:19)
  at /opt/atom/resources/app.asar/src/text-editor.js:1387:23
  at TextEditor.module.exports.TextEditor.moveCursors (/opt/atom/resources/app.asar/src/text-editor.js:1593:9)
  at TextEditor.module.exports.TextEditor.setCursorScreenPosition (/opt/atom/resources/app.asar/src/text-editor.js:1386:19)
  at TextEditorComponent.module.exports.TextEditorComponent.onMouseDown (/opt/atom/resources/app.asar/src/text-editor-component.js:562:25)
  at HTMLDivElement.<anonymous> (/opt/atom/resources/app.asar/src/text-editor-component.js:3:61)

Commands

  3x -7:58.3.0 core:undo (atom-text-editor.editor.is-focused)
     -7:55.9.0 core:save (atom-text-editor.editor.is-focused)
     -4:28.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "nucleus-dark-ui",
      "apathy-theme"
    ]
  },
  "apathy-theme": {}
}

Installed Packages

# User
apathy-theme, v1.7.3
language-javascript-jsx, v0.3.7
meteor-api, v2.20.0
nucleus-dark-ui, v0.6.2

# Dev
No dev packages

Hi, thanks for reporting this. This is due to changes in atom. In the past there were issues where character widths would get measured before external fonts are loaded, causing display issues. I worked around it with a hack to for character re-measurements.

It looks like Atom has fixed that issue and removed the methods we were using to do that, which I think caused your error. I've removed the outdated code and pushed a commit which should fix your problem. Please update to the newest version of Apathy which has the fix. If the issue happens still, please reopen this issue.

Thanks!