From 34e9e93210497d92a388e2ee31be7a5b25b5abe6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 5 Jul 2018 19:59:08 +0100 Subject: [PATCH] PluginBase: fixed crashing on getConfig() when data dir doesn't exist I considered making this instead save the default config instead of creating an empty config file, but that would be (albeit minor) a behavioural change which therefore belongs in 3.1. --- src/pocketmine/plugin/PluginBase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pocketmine/plugin/PluginBase.php b/src/pocketmine/plugin/PluginBase.php index 3001b0a426..bba7231e9d 100644 --- a/src/pocketmine/plugin/PluginBase.php +++ b/src/pocketmine/plugin/PluginBase.php @@ -256,6 +256,7 @@ abstract class PluginBase implements Plugin{ } public function reloadConfig(){ + @mkdir($this->dataFolder); $this->config = new Config($this->configFile); if(($configStream = $this->getResource("config.yml")) !== null){ $this->config->setDefaults(yaml_parse(Config::fixYAMLIndexes(stream_get_contents($configStream))));