From e812ada4db11536fd8ddfb67410c436d792909b1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 13 Mar 2024 14:39:49 +0100 Subject: Handle non-string option values in option_to_english. --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server.js') diff --git a/server.js b/server.js index 45fb015..29286e0 100644 --- a/server.js +++ b/server.js @@ -1146,7 +1146,9 @@ function option_to_english(k) { return "yes" if (k === false) return "no" - return k.replace(/_/g, " ").replace(/^\w/, (c) => c.toUpperCase()) + if (typeof k === "string") + return k.replace(/_/g, " ").replace(/^\w/, (c) => c.toUpperCase()) + return k } function format_options(options_json, options) { -- cgit v1.2.3