diff --git a/gdb/remote.c b/gdb/remote.c
index 735774903f3..2961664cf33 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -12767,12 +12767,15 @@ cli_packet_command (const char *args, int from_tty)
    The split and joined arguments are printed out.  Additionally, the
    joined arguments are split and joined a second time, and compared to the
    result of the first join, this provides some basic validation that GDB
-   sess the joined arguments as equivalent to the original argument
+   sees the joined arguments as equivalent to the original argument
    string.  */
 
 static void
 test_remote_args_command (const char *args, int from_tty)
 {
+  if (args == nullptr)
+    error (_("missing argument string"));
+
   std::vector<std::string> split_args = gdb::remote_args::split (args);
 
   gdb_printf ("Input (%s)\n", args);
diff --git a/gdb/testsuite/gdb.base/maint-test-remote-args.exp b/gdb/testsuite/gdb.base/maint-test-remote-args.exp
index b1a3e67abc6..22d9e81c25d 100644
--- a/gdb/testsuite/gdb.base/maint-test-remote-args.exp
+++ b/gdb/testsuite/gdb.base/maint-test-remote-args.exp
@@ -38,3 +38,6 @@ gdb_test "maint test-remote-args a b c" \
 	 "  \\(b\\)" \
 	 "  \\(c\\)" \
 	 "Output \\(a b c\\)"]
+
+gdb_test "maint test-remote-args" "^missing argument string" \
+    "command without an argument string"
