diff --git a/CHANGELOG.md b/CHANGELOG.md index 26a24d9..e9e2efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.2] + +* Fix edge case where the server config can possibly be saved with no data + ## [2.1.1] * Launcher adjustment to not grep for process name of "admin" when detecting if the launcher is booted diff --git a/app/core/eqemu-config-service.js b/app/core/eqemu-config-service.js index 6af2908..11fc3bc 100644 --- a/app/core/eqemu-config-service.js +++ b/app/core/eqemu-config-service.js @@ -146,11 +146,17 @@ module.exports = { */ saveServerConfig(data = undefined) { if (!data) { + this.reload() data = this.getServerConfig(); } debug('[saveServerConfig] writing config'); + if (typeof data !== "undefined" && data.length === 0) { + this.reload() + return + } + fs.writeFileSync( this.getServerConfigPath(), JSON.stringify(data, null, 1), diff --git a/package.json b/package.json index 69f8f77..28bc493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eqemu-admin", - "version": "2.1.1", + "version": "2.1.2", "private": true, "bin": "./app/bin/admin", "scripts": {