From 712607b05ac7c28a35e4682269adc53257ab9337 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen <larsi@gnus.org>
Date: Fri, 13 Apr 2018 18:35:07 +0200
Subject: [PATCH] Fix bug in shr-urlify introduced in previous patch

* lisp/net/shr.el (shr-urlify): Not all URLs have domains, so
check for that before doing IDNA.
---
 lisp/net/shr.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 7b8c841d9dc..5ffaf153c38 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1221,8 +1221,9 @@ START, and END.  Note that START and END should be markers."
                       ;; decoded version in the mouseover to let the
                       ;; user know that there's something possibly
                       ;; fishy.
-                      (setf (url-host parsed)
-                            (puny-encode-domain (url-host parsed)))
+                      (when (url-host parsed)
+                        (setf (url-host parsed)
+                              (puny-encode-domain (url-host parsed))))
                       (setq iri (url-recreate-url parsed))
 		      (if title
                           (format "%s (%s)" iri title)
-- 
2.39.5