jojojames / dired-sidebar

Sidebar for Emacs leveraging Dired
GNU General Public License v3.0
513 stars 22 forks source link

dired-sidebar-point-at-file error split-string on nil #51

Closed stardiviner closed 4 years ago

stardiviner commented 4 years ago

When I press key of command dired-sidebar-toggle-sidebar. I got following error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      string-match("/" nil 0)
      split-string(nil "/")
      dired-sidebar-point-at-file("/home/stardiviner/.config/emacs/init/programming/c..." "/home/stardiviner/Git/dotfiles/.config/emacs/")
      dired-sidebar-toggle-sidebar()
      funcall-interactively(dired-sidebar-toggle-sidebar)
      call-interactively(dired-sidebar-toggle-sidebar nil nil)
      command-execute(dired-sidebar-toggle-sidebar)

When I Edebug on function dired-sidebar-point-at-file. It is:

(split-string (cadr (split-string "/home/stardiviner/.config/emacs/init/programming/code browser/init-prog-sidebar.el" "/home/stardiviner/Git/dotfiles/.config/emacs/")) "/")
stardiviner commented 4 years ago

Gentle ping ...

jojojames commented 4 years ago

Hmnn, there's probably a bug here but I can't reproduce it on my own. A really easy to reproduce recipe will help here, otherwise PR very welcome too.

stardiviner commented 4 years ago

Hi @jojojames , I created PR to fix this error now.