Skip to content

Commit

Permalink
Fix crash in conf/etc. with empty optional values
Browse files Browse the repository at this point in the history
  • Loading branch information
NuSkooler committed Dec 24, 2023
1 parent 6aa0c86 commit 223b7b2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
Binary file modified art/themes/luciano_blocktronics/CONFSCR.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/NUA.ANS
Binary file not shown.
3 changes: 3 additions & 0 deletions core/color_codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ function ansiSgrFromCnetStyleColorCode(cc) {
}

function renegadeToAnsi(s, client) {
if (!s) {
return '';
}
if (-1 == s.indexOf('|')) {
return s; // no pipe codes present
}
Expand Down
4 changes: 4 additions & 0 deletions core/string_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const SIMPLE_ELITE_MAP = {
};

function stylizeString(s, style) {
if (!s) {
return '';
}

var len = s.length;
var c;
var i;
Expand Down
6 changes: 5 additions & 1 deletion core/text_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ TextView.prototype.setText = function (text, redraw) {

if (!_.isString(text)) {
// allow |text| to be numbers/etc.
text = text.toString();
if (_.isUndefined(text) || null === text) {
text = '';
} else {
text = text.toString();
}
}

const formatObj = getPredefinedMCIFormatObject(this.client, text);
Expand Down

0 comments on commit 223b7b2

Please sign in to comment.