summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-03-13 14:39:49 +0100
committerTor Andersson <tor@ccxvii.net>2024-03-13 14:40:59 +0100
commite812ada4db11536fd8ddfb67410c436d792909b1 (patch)
tree3e9cbdf3cfa38adbde0b0145099ecf64fa695c13 /server.js
parent918691acfc7bd4b4f197c41926068f0d086279ac (diff)
downloadserver-e812ada4db11536fd8ddfb67410c436d792909b1.tar.gz
Handle non-string option values in option_to_english.
Diffstat (limited to 'server.js')
-rw-r--r--server.js4
1 files changed, 3 insertions, 1 deletions
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) {