Skip to content

Commit 0fcb255

Browse files
authored
Merge pull request #771 from atom-minimap/null-bugs
Fix strange null bugs
2 parents bc4fecb + f146ef8 commit 0fcb255

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/minimap-element.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,12 @@ class MinimapElement {
429429
if (minimaps.length) {
430430
Array.prototype.forEach.call(minimaps, (el) => {
431431
el.destroy()
432-
container.removeChild(el)
432+
try {
433+
container.removeChild(el)
434+
} catch (e) {
435+
// TODO: ignore for now
436+
// https://github.com/atom-minimap/minimap/issues/766#issuecomment-762496374
437+
}
433438
})
434439
}
435440
container.appendChild(this)

lib/minimap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,9 @@ export default class Minimap {
10881088
* @return {DecorationManagement}
10891089
*/
10901090
getDecorationManagement () {
1091-
if (this.DecorationManagement === undefined) {
1091+
if (this.DecorationManagement === undefined &&
1092+
this.minimapElement // TODO: find why this becomes null: https://github.com/atom-minimap/minimap/issues/766
1093+
) {
10921094
this.DecorationManagement = this.minimapElement.DecorationManagement
10931095
}
10941096
return this.DecorationManagement

0 commit comments

Comments
 (0)