Fix IDEA error in safeWaitForPos()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 29 Jan 2016 22:47:38 +0000 (14:47 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 29 Jan 2016 22:47:38 +0000 (14:47 -0800)
Change-Id: Iecb023925177be05282f67e48056aeb8f2a9703c

includes/db/loadbalancer/LoadBalancer.php

index fc7fa13..97df0d6 100644 (file)
@@ -1391,6 +1391,9 @@ class LoadBalancer {
                }
 
                $pos = $pos ?: $this->getConnection( DB_MASTER )->getMasterPos();
+               if ( !$pos ) {
+                       return false; // something is misconfigured
+               }
 
                $result = $conn->masterPosWait( $pos, $timeout );
                if ( $result == -1 || is_null( $result ) ) {