From 4f6891a668da4b82c960c77020ac6c7c9610bbca Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Fri, 27 Jan 2023 16:27:33 -0600 Subject: [PATCH] Fix possible BBS crash on undefined text --- core/text_view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/text_view.js b/core/text_view.js index 74b622ba..770a279f 100644 --- a/core/text_view.js +++ b/core/text_view.js @@ -151,6 +151,11 @@ TextView.prototype.getData = function () { TextView.prototype.setText = function (text, redraw) { redraw = _.isBoolean(redraw) ? redraw : true; + // Don't bomb if text isn't defined, just treat as blank instead. + if (_.isUndefined(text)) { + text = ''; + } + if (!_.isString(text)) { // allow |text| to be numbers/etc. text = text.toString();