Skip to content

Commit

Permalink
null check executable path
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohme committed Mar 11, 2022
1 parent 8d5ef50 commit a93bf9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flymake-yamllint.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
(if (not flymake-yamllint-program)
(error "No yamllint program name set"))
(let ((flymake-yamllint--executable-path (executable-find flymake-yamllint-program)))
(if (not (file-executable-p flymake-yamllint--executable-path))
(error "Could not find yamllint executable"))
(if (or (null flymake-yamllint--executable-path)
(not (file-executable-p flymake-yamllint--executable-path)))
(error "Could not find '%s' executable" flymake-yamllint-program))
(when (process-live-p flymake-yamllint--proc)
(kill-process flymake-yamllint--proc)
(setq flymake-yamllint--proc nil))
Expand Down

0 comments on commit a93bf9a

Please sign in to comment.