Fix possible BBS crash on undefined text
This commit is contained in:
parent
8dd28e3091
commit
4f6891a668
|
@ -151,6 +151,11 @@ TextView.prototype.getData = function () {
|
||||||
TextView.prototype.setText = function (text, redraw) {
|
TextView.prototype.setText = function (text, redraw) {
|
||||||
redraw = _.isBoolean(redraw) ? redraw : true;
|
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)) {
|
if (!_.isString(text)) {
|
||||||
// allow |text| to be numbers/etc.
|
// allow |text| to be numbers/etc.
|
||||||
text = text.toString();
|
text = text.toString();
|
||||||
|
|
Loading…
Reference in New Issue