unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Yuwei Tian <fishtai0@gmail.com>
Cc: 71270@debbugs.gnu.org
Subject: bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error
Date: Thu, 30 May 2024 09:46:17 +0300	[thread overview]
Message-ID: <86y17rg5hq.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAC9=Ainz+nC53v-FELP01sDGJ2bWeDNa2ctiXR9y_nLfgKqngw@mail.gmail.com> (Yuwei Tian's message of "Thu, 30 May 2024 14:24:35 +0800")

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.





  reply	other threads:[~2024-05-30  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  6:24 bug#71270: 30.0.50; Execute dired-do-shell-command will encounter 'wrong-type-argument stringp nil' error Yuwei Tian
2024-05-30  6:46 ` Juri Linkov [this message]
2024-05-30  6:52 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y17rg5hq.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=71270@debbugs.gnu.org \
    --cc=fishtai0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).