Fixed issue when starting without any configuration data present.
This commit is contained in:
parent
a7a05f04bd
commit
03b3b6b0a3
1 changed files with 1 additions and 2 deletions
|
@ -124,12 +124,11 @@ namespace SharpChat {
|
||||||
|
|
||||||
|
|
||||||
const string mdb_config = @"mariadb.txt";
|
const string mdb_config = @"mariadb.txt";
|
||||||
bool hasMDB = File.Exists(mdb_config);
|
|
||||||
string[] mdbCfg = File.Exists(mdb_config) ? File.ReadAllLines(mdb_config) : Array.Empty<string>();
|
string[] mdbCfg = File.Exists(mdb_config) ? File.ReadAllLines(mdb_config) : Array.Empty<string>();
|
||||||
|
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
sw.WriteLine("# MariaDB configuration");
|
sw.WriteLine("# MariaDB configuration");
|
||||||
if(!string.IsNullOrWhiteSpace(mdbCfg[0]))
|
if(mdbCfg.Length > 0)
|
||||||
sw.WriteLine($"mariadb:host {mdbCfg[0]}");
|
sw.WriteLine($"mariadb:host {mdbCfg[0]}");
|
||||||
else
|
else
|
||||||
sw.WriteLine($"#mariadb:host <username>");
|
sw.WriteLine($"#mariadb:host <username>");
|
||||||
|
|
Loading…
Reference in a new issue