Skip to content

Commit

Permalink
Fix #47
Browse files Browse the repository at this point in the history
  • Loading branch information
Muqsit authored Feb 27, 2018
1 parent f42658c commit 6d99be8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ChestShop/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,8 @@ public function onDisable() : void{
*/
private function updateConfig(string $config) : void{
if(isset(self::CONFIG[$config])){
$data = [];
if(is_file($path = $this->getDataFolder().$config)){
$data = yaml_parse_file($path);
}
$path = $this->getDataFolder().$config;
$data = is_file($path) ? yaml_parse_file($path) : self::CONFIG[$config];
foreach(self::CONFIG[$config] as $key => $value){
if(!isset($data[$key])){
$data[$key] = $value;
Expand Down

0 comments on commit 6d99be8

Please sign in to comment.