Merge "Throw exception in importDump instead of dumping a random backtrace and erroring"
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 81edc49..1b014f6 100644 (file)
@@ -38,7 +38,9 @@ class MediaWiki {
         */
        public function request( WebRequest $x = null ) {
                $old = $this->context->getRequest();
-               $this->context->setRequest( $x );
+               if ( $x ) {
+                       $this->context->setRequest( $x );
+               }
                return $old;
        }
 
@@ -48,7 +50,9 @@ class MediaWiki {
         */
        public function output( OutputPage $x = null ) {
                $old = $this->context->getOutput();
-               $this->context->setOutput( $x );
+               if ( $x ) {
+                       $this->context->setOutput( $x );
+               }
                return $old;
        }