GNU bug report logs -
#71270
30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error
Previous Next
Reported by: Yuwei Tian <fishtai0 <at> gmail.com>
Date: Thu, 30 May 2024 06:26:01 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 71270 <at> debbugs.gnu.org (full text, mbox):
close 71270 30.0.50
thanks
> After commit 74f15ad72d937b309dafecba872bccd1a880181e, it will
> encounter 'wrong-type-argument string nil' error when executing
> dired-do-shell-command.
>
> Here is the backtrace:
>
> string-match("/" nil 0)
> split-string(nil "/")
> xdg-mime-apps(nil)
> shell-command-guess-xdg(nil ("xxxxxxx"))
>
> The shell-command-guess-xdg is being called in the chain of
> shell-command-guess-functions. Here is the definition of
> shell-command-guess-xdg function:
Thanks for the detailed analysis.
> xdg-mime will be nil if xdg-mime not found, string-empty-p returns
> nil and xdg-mime-apps will be called with nil.
I didn't expect that string-empty-p returns nil for nil
(maybe because I'm accustomed to programming languages
where "" and nil both are empty):
(string-empty-p "") => t
(string-empty-p nil) => nil
So now I added the explicit check for the nil value, and pushed the fix.
This bug report was last modified 356 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.