mirror of https://github.com/espruino/BangleApps
Return empty array instead of object if JSON read fails
parent
936b6aabee
commit
beff82a2f9
|
@ -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),
|
||||||
|
|
Loading…
Reference in New Issue