diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 9196cf44d981227801990bbcc8ab82bb4cff36a4..59542aa1d3d442aa7556b3ca15c1b9c3c0aeb403 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -617,9 +617,6 @@ main(int argc, char **argv)
 	/* Register the cleanup hook */
 	on_exit_close_archive(fout);
 
-	if (fout == NULL)
-		exit_horribly(NULL, "could not open output file \"%s\" for writing\n", filename);
-
 	/* Let the archiver know how noisy to be */
 	fout->verbose = g_verbose;