Fix 500 Internal Server Error with empty mods list.
This commit is contained in:
parent
03125d8b47
commit
928b0951b4
1 changed files with 1 additions and 1 deletions
|
@ -325,7 +325,7 @@ if (href == "/") {
|
||||||
parsedJsonData.mods.forEach(function (mod) {
|
parsedJsonData.mods.forEach(function (mod) {
|
||||||
entriesToInsert.push("(" + mysql.escape(results.insertId) + ", " + mysql.escape(mod.name) + ", " + mysql.escape(mod.version) + ")");
|
entriesToInsert.push("(" + mysql.escape(results.insertId) + ", " + mysql.escape(mod.name) + ", " + mysql.escape(mod.version) + ")");
|
||||||
});
|
});
|
||||||
connection.query("INSERT INTO entries_mods (entry_id, name, version) VALUES " + entriesToInsert.join(", ") + ";", function (error, results, fields) {
|
connection.query(entriesToInsert.length > 0 ? ("INSERT INTO entries_mods (entry_id, name, version) VALUES " + entriesToInsert.join(", ") + ";") : "SELECT 1;", function (error, results, fields) {
|
||||||
if (error) {
|
if (error) {
|
||||||
serverconsole.errmessage("There was an error while processing the request!");
|
serverconsole.errmessage("There was an error while processing the request!");
|
||||||
serverconsole.errmessage("Stack:");
|
serverconsole.errmessage("Stack:");
|
||||||
|
|
Loading…
Reference in a new issue