diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index b6133b6af0ff60af1997dcb6abb1edf1ad93c1e3..fa45bd48a64c89ad4abcd2b5761e55925d0de9ae 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -486,7 +486,7 @@ (define %options
                              arg-handler))))
          (option '(#\u "upgrade") #f #t
                  (lambda (opt name arg result arg-handler)
-                   (when (string-prefix? "-" arg)
+                   (when (and arg (string-prefix? "-" arg))
                      (warning (G_ "upgrade regexp '~a' looks like a \
 command-line option~%")
                               arg)