Fix for #2801.
Ylian Saint-Hilaire committed
Jun 22, 2021 at 08:40 UTC
f48536c40dec850b138d4f5089837f964a96090e
1 file changed
+2
-2
db.js
+2
-2
@@ -1563,8 +1563,8 @@ module.exports.CreateDB = function (parent, func) {
1563
1564
var dbname = 'meshcentral';
1565
if (parent.args.mongodbname) { dbname = parent.args.mongodbname; }
1566
- else if (parent.args.mariadb.database) { dbname = parent.args.mariadb.database; }
1567
- else if (parent.args.mysql.database) { dbname = parent.args.mysql.database; }
1566
+ else if ((typeof parent.args.mariadb == 'object') && (typeof parent.args.mariadb.database == 'string')) { dbname = parent.args.mariadb.database; }
1567
+ else if ((typeof parent.args.mysql == 'object') && (typeof parent.args.mysql.database == 'string')) { dbname = parent.args.mysql.database; }
1568
1569
const currentDate = new Date();
1570
const fileSuffix = currentDate.getFullYear() + '-' + padNumber(currentDate.getMonth() + 1, 2) + '-' + padNumber(currentDate.getDate(), 2) + '-' + padNumber(currentDate.getHours(), 2) + '-' + padNumber(currentDate.getMinutes(), 2);