From edde8148a2664515a1fead040d4ca44bef99701f Mon Sep 17 00:00:00 2001 From: Lysogorskiy Aleksey Date: Thu, 12 Jul 2018 11:58:29 +0300 Subject: [PATCH] fix #3290 (catch exception when search file in malformed paths) --- src/Paket.Core/Common/ProcessHelper.fs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Paket.Core/Common/ProcessHelper.fs b/src/Paket.Core/Common/ProcessHelper.fs index a352b922e3..eed6a98bdb 100644 --- a/src/Paket.Core/Common/ProcessHelper.fs +++ b/src/Paket.Core/Common/ProcessHelper.fs @@ -15,6 +15,7 @@ let tryFindFile dirs file = let files = dirs |> Seq.map (fun (path : string) -> + try let dir = DirectoryInfo( path @@ -26,7 +27,13 @@ let tryFindFile dirs file = else let fi = FileInfo(Path.Combine(dir.FullName,file)) if fi.Exists then fi.FullName - else "") + else "" + with + | exn -> + Logging.verbosefn "Exception while searching %s in %s:" file path + Logging.verbosefn "%O" exn + + "") |> Seq.filter ((<>) "") |> Seq.cache if not (Seq.isEmpty files) then Some(Seq.head files)