mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Only subscribe when file exists
This commit is contained in:
@@ -32,7 +32,7 @@ class File
|
||||
|
||||
subscriptionsAdded = eventNames.map (eventName) -> "first-#{eventName}-subscription-will-be-added"
|
||||
@on subscriptionsAdded.join(' '), =>
|
||||
@subscribeToNativeChangeEvents()
|
||||
@subscribeToNativeChangeEvents() if @exists()
|
||||
|
||||
subscriptionsRemoved = eventNames.map (eventName) -> "last-#{eventName}-subscription-removed"
|
||||
@on subscriptionsRemoved.join(' '), =>
|
||||
|
||||
Reference in New Issue
Block a user