From f9a54ae55299c3eff8e727c543f115f2909a48db Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Sun, 5 Jul 2015 08:35:26 +0200 Subject: [PATCH] Check if error message exists before using it --- src/pane.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index f77da9d58..76d83a175 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -677,7 +677,7 @@ class Pane extends Model true handleSaveError: (error) -> - if error.code is 'EISDIR' or error.message.endsWith('is a directory') + if error.code is 'EISDIR' or error.message?.endsWith('is a directory') atom.notifications.addWarning("Unable to save file: #{error.message}") else if error.code is 'EACCES' and error.path? atom.notifications.addWarning("Unable to save file: Permission denied '#{error.path}'")