From: Sebastian Wiesner <swiesner@lunaryorn.com>
Date: Tue, 25 Oct 2016 10:19:34 +0200
Subject: Don't fail if stack path --project-root fails

Origin: upstream,61fb052
Forwarded: not-needed
---
 flycheck.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/flycheck.el b/flycheck.el
index 2f2cec8..8c5ccd9 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -7370,13 +7370,11 @@ contains a cabal file."
     (`haskell-stack-ghc
      (or
       (locate-dominating-file (buffer-file-name) "stack.yaml")
-      (when (executable-find "stack")
-        (let* ((stack-output
-                (process-lines "stack" "path" "--project-root"))
-               (stack-dir (car stack-output)))
-          (when (and stack-dir
-                     (file-directory-p stack-dir))
-            stack-dir)))))
+      (-when-let* ((stack (funcall flycheck-executable-find "stack"))
+                   (output (ignore-errors
+                             (process-lines stack "path" "--project-root")))
+                   (stack-dir (car output)))
+        (and (file-directory-p stack-dir) stack-dir))))
     (_
      (locate-dominating-file
       (file-name-directory (buffer-file-name))
