diff --git a/compiler/main.lisp b/compiler/main.lisp
index 72f84285256705423327b5fb97cec8cb40f2f1f1..a5d619dd304a9580ad259ffc21de679cf3d1ae68 100644
--- a/compiler/main.lisp
+++ b/compiler/main.lisp
@@ -1323,6 +1323,10 @@
 
       (when error-file-stream
 	(let ((name (pathname error-file-stream)))
+	  ;;
+	  ;; Leave this var pointing to something reasonable in case someone
+	  ;; tries to use it before the LET ends, e.g. during the LOAD.
+	  (setq *compiler-error-output* *error-output*)
 	  (close error-file-stream)
 	  (when (and compile-won (not error-severity))
 	    (delete-file name))))