mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Null guard target check to keep tests simple
This commit is contained in:
committed by
Antonio Scandurra
parent
df4d52c89a
commit
625990d22f
@@ -769,7 +769,7 @@ class TextEditorComponent {
|
||||
|
||||
const screenPosition = this.screenPositionForMouseEvent(event)
|
||||
|
||||
if (target.matches('.fold-marker')) {
|
||||
if (target && target.matches('.fold-marker')) {
|
||||
const bufferPosition = model.bufferPositionForScreenPosition(screenPosition)
|
||||
model.destroyFoldsIntersectingBufferRange(Range(bufferPosition, bufferPosition))
|
||||
return
|
||||
@@ -829,7 +829,7 @@ class TextEditorComponent {
|
||||
const clickedScreenRow = this.screenPositionForMouseEvent(event).row
|
||||
const startBufferRow = model.bufferPositionForScreenPosition([clickedScreenRow, 0]).row
|
||||
|
||||
if (target.matches('.foldable .icon-right')) {
|
||||
if (target && target.matches('.foldable .icon-right')) {
|
||||
model.toggleFoldAtBufferRow(startBufferRow)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user