diff --git a/clients/lsp-trunk.el b/clients/lsp-trunk.el index f72c3d0203..335c99fc57 100644 --- a/clients/lsp-trunk.el +++ b/clients/lsp-trunk.el @@ -44,8 +44,8 @@ (defun lsp-trunk-check-for-init (filename &optional _) "Check if the file exists in a workspace that has a .trunk/trunk.yaml" - (let ((dir (file-name-directory filename)) - (trunk-file ".trunk/trunk.yaml")) + (when-let* ((dir (file-name-directory filename)) + (trunk-file ".trunk/trunk.yaml")) (locate-dominating-file dir trunk-file))) (defun lsp-trunk-check-disable (command)