diff options
author | Michael Olson <mwolson@gnu.org> | 2006-05-17 03:54:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-05-17 03:54:00 +0000 |
commit | 3fe590d6b34b30a6d76c6a7a888a8fb49debbdaf (patch) | |
tree | 7705fb1697f8004dd598455c1f350b4b237ccabd | |
parent | 7cb108237e5ebe3fd996e9587d7d68b3349c90ef (diff) |
emms-player-mpd: Add a few checks to make sure that the given buffer exists before trying to do anything with it.
darcs-hash:20060517035419-1bfb2-3b5eada9a5b8232067d491f2e607ef3ae3e35c3a.gz
-rw-r--r-- | emms-player-mpd.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el index db3511d..9ef3431 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -755,10 +755,11 @@ playlist." (when emms-player-mpd-status-timer (emms-cancel-timer emms-player-mpd-status-timer) (setq emms-player-mpd-status-timer nil)) - (let ((emms-playlist-buffer buffer)) - (with-current-emms-playlist - (emms-player-mpd-play (1- (emms-line-number-at-pos - emms-playlist-selected-marker)))))) + (when (buffer-live-p buffer) + (let ((emms-playlist-buffer buffer)) + (with-current-emms-playlist + (emms-player-mpd-play (1- (emms-line-number-at-pos + emms-playlist-selected-marker))))))) (defun emms-player-mpd-start-and-sync () "Ensure that MusicPD's playlist is up-to-date with EMMS's @@ -898,8 +899,9 @@ positive or negative." (cond ((functionp callback) (funcall callback buffer desc)) (insertp - (with-current-buffer buffer - (insert desc))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (insert desc)))) (t (message "%s" desc)))))) |