PluginDescription: fix precedence issue with ?? and cast

this would cause issues if the api field was null or not found.
This commit is contained in:
Dylan K. Taylor
2018-06-11 13:53:49 +01:00
parent eb0276d459
commit 13fe8ee96d

View File

@ -81,7 +81,7 @@ class PluginDescription{
throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace"); throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace");
} }
$this->api = array_map("strval", (array) $plugin["api"] ?? []); $this->api = array_map("strval", (array) ($plugin["api"] ?? []));
$this->compatibleMcpeProtocols = array_map("intval", (array) ($plugin["mcpe-protocol"] ?? [])); $this->compatibleMcpeProtocols = array_map("intval", (array) ($plugin["mcpe-protocol"] ?? []));
if(isset($plugin["commands"]) and is_array($plugin["commands"])){ if(isset($plugin["commands"]) and is_array($plugin["commands"])){