]> git.joonet.de Git - adminer.git/commitdiff
MSSQL: avoid warnings if result is invalid
authorGargaj <gargaj@conspiracy.hu>
Fri, 19 Sep 2014 12:41:45 +0000 (14:41 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 6 Oct 2014 16:11:59 +0000 (09:11 -0700)
adminer/drivers/mssql.inc.php

index c0b6268e4528cd4656e618c0115d2561a03856dc..423855e04ce41fe6c3a5c19121ca4f3c88a8578a 100644 (file)
@@ -66,6 +66,9 @@ if (isset($_GET["mssql"])) {
                                if (!$result) {
                                        $result = $this->_result;
                                }
+                               if (!$result) {
+                                       return false;
+                               }
                                if (sqlsrv_field_metadata($result)) {
                                        return new Min_Result($result);
                                }
@@ -74,7 +77,7 @@ if (isset($_GET["mssql"])) {
                        }
 
                        function next_result() {
-                               return sqlsrv_next_result($this->_result);
+                               return $this->_result ? sqlsrv_next_result($this->_result) : null;
                        }
 
                        function result($query, $field = 0) {