Make sure $dbw is an object in DeferredUpdates::addUpdate()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 21 May 2015 06:06:05 +0000 (23:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 21 May 2015 06:06:05 +0000 (23:06 -0700)
Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056

includes/deferred/DeferredUpdates.php

index 29bb8d7..082d435 100644 (file)
@@ -65,7 +65,7 @@ class DeferredUpdates {
                        $lb = wfGetLB();
                        $dbw = $lb->getAnyOpenConnection( $lb->getWriterIndex() );
                        // Do the update as soon as there is no transaction
-                       if ( $dbw->trxLevel() ) {
+                       if ( $dbw && $dbw->trxLevel() ) {
                                $waitingOnTrx = true;
                                $dbw->onTransactionIdle( function() use ( &$waitingOnTrx ) {
                                        DeferredUpdates::doUpdates();