--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -4227,11 +4227,7 @@
 (defun erc-format-nick (&optional user _channel-data)
   "Return the nickname of USER.
 See also `erc-format-nick-function'."
-  (let ((nick (erc-server-user-nickname user)))
-    (concat (erc-propertize
-             (erc-get-user-mode-prefix nick)
-             'face 'erc-nick-prefix-face)
-	    nick)))
+  (when user (erc-server-user-nickname user)))
 
 (defun erc-get-user-mode-prefix (user)
   (when user
