mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Catch read errors during deserialization
Prevents Atom from failing to open because of a read error with a serialized editor.
This commit is contained in:
@@ -128,7 +128,15 @@ class TextEditor extends Model
|
||||
displayBuffer: @displayBuffer.serialize()
|
||||
|
||||
deserializeParams: (params) ->
|
||||
params.displayBuffer = DisplayBuffer.deserialize(params.displayBuffer)
|
||||
try
|
||||
displayBuffer = DisplayBuffer.deserialize(params.displayBuffer)
|
||||
catch error
|
||||
if error.syscall is 'read'
|
||||
return # Error reading the file, don't deserialize an editor for it
|
||||
else
|
||||
throw error
|
||||
|
||||
params.displayBuffer = displayBuffer
|
||||
params.registerEditor = true
|
||||
params
|
||||
|
||||
|
||||
Reference in New Issue
Block a user