From 4971c78b04b99639a8c17430d9e74bfae22e4676 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 20 Oct 2022 12:36:32 +0200 Subject: [PATCH] Fix a MethodError crash when filepath not found. --- src/requests/actions.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/requests/actions.jl b/src/requests/actions.jl index 63f47b25..46c5f32b 100644 --- a/src/requests/actions.jl +++ b/src/requests/actions.jl @@ -355,9 +355,12 @@ function get_spdx_header(doc::Document) end function in_same_workspace_folder(server::LanguageServerInstance, file1::URI, file2::URI) + file1_str = uri2filepath(file1) + file2_str = uri2filepath(file2) + (file1_str === nothing || file2_str === nothing) && return false for ws in server.workspaceFolders - if startswith(uri2filepath(file1), ws) && - startswith(uri2filepath(file2), ws) + if startswith(file1_str, ws) && + startswith(file2_str, ws) return true end end