summaryrefslogtreecommitdiff
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 1c296fe1..749e5056 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -2493,6 +2493,8 @@ function id(x) { return x; }
function sub(s, i) {
var ch = undefined;
iterateString(s, function(c, idx) { if (idx == i) { ch = c; return false; }});
+ if (ch == undefined)
+ er("String index " + i + " out of bounds")
return ch;
}
function suf(s, i) {