Return empty array instead of object if JSON read fails

pull/3473/head
Brian Whelan 2024-06-24 18:22:09 +01:00 committed by GitHub
parent 936b6aabee
commit beff82a2f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ exports.reply = function (options) {
require("Storage").readJSON( require("Storage").readJSON(
options.fileOverride || "replies.json", options.fileOverride || "replies.json",
true true
) || {}; ) || [];
replies.forEach((reply) => { replies.forEach((reply) => {
menu = Object.defineProperty(menu, reply.text, { menu = Object.defineProperty(menu, reply.text, {
value: () => constructReply(options.msg ?? {}, reply.text, resolve), value: () => constructReply(options.msg ?? {}, reply.text, resolve),