fix(default): browse-project: stringp type error

doom-project-root can return nil if not in a project, causing a type
error (#7093). This changes +default/browse-project to fall back to the
current directory in that case.

Fix: #7093
This commit is contained in:
Henrik Lissner 2023-02-21 19:15:36 -05:00
parent c523cd0e93
commit 45d25af436
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -3,7 +3,8 @@
;;;###autoload ;;;###autoload
(defun +default/browse-project () (defun +default/browse-project ()
"Browse files from the current project's root." "Browse files from the current project's root."
(interactive) (doom-project-browse (doom-project-root))) (interactive)
(doom-project-browse (or (doom-project-root) default-directory)))
;; NOTE No need for find-in-project, use `projectile-find-file' ;; NOTE No need for find-in-project, use `projectile-find-file'
;;;###autoload ;;;###autoload