From: Gargaj Date: Fri, 5 Sep 2014 23:20:20 +0000 (+0200) Subject: Elasticsearch: check for valid mappings X-Git-Tag: v4.2.0~53 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=9315954f3ea250bb8447d3336aed14114075dfb1;p=adminer.git Elasticsearch: check for valid mappings --- diff --git a/adminer/drivers/elastic.inc.php b/adminer/drivers/elastic.inc.php index 397ca6b9..3aac8331 100644 --- a/adminer/drivers/elastic.inc.php +++ b/adminer/drivers/elastic.inc.php @@ -280,13 +280,15 @@ if (isset($_GET["elastic"])) { if (!$mappings) { $mappings = $result[$connection->_db]['mappings'][$table]['properties']; } - foreach ($mappings as $name => $field) { - $return[$name] = array( - "field" => $name, - "full_type" => $field["type"], - "type" => $field["type"], - "privileges" => array("insert" => 1, "select" => 1, "update" => 1), - ); + if ($mappings) { + foreach ($mappings as $name => $field) { + $return[$name] = array( + "field" => $name, + "full_type" => $field["type"], + "type" => $field["type"], + "privileges" => array("insert" => 1, "select" => 1, "update" => 1), + ); + } } } return $return;