jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
828 stars 68 forks source link

`async-when-done` raises errors when `process-buffer` returns `nil` #126

Open sdevlin opened 4 years ago

sdevlin commented 4 years ago

async-when-done may encounter an error when process-status returns exit and process-buffer returns nil. I think this error can arise due to race conditions when a process exits cleanly but its buffer is deleted before the sentinel is invoked.

I think async-when-done should check if the buffer exists and do something sensible if it does not. Maybe it should raise an explicit error, since this sort of race condition is almost certainly a bug in the program using async.