Skip to content

Commit

Permalink
Merge pull request #1670 from Tyriar/1669_linkifier_exception
Browse files Browse the repository at this point in the history
Fallback on default color when linkifier can't find the character
  • Loading branch information
Tyriar committed Sep 9, 2018
2 parents 7ef18cc + f4bb4a2 commit f9717bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Linkifier.ts
Expand Up @@ -220,8 +220,11 @@ export class Linkifier extends EventEmitter implements ILinkifier {
// Get cell color
const line = this._terminal.buffer.lines.get(this._terminal.buffer.ydisp + rowIndex);
const char = line.get(index);
const attr: number = char[CHAR_DATA_ATTR_INDEX];
const fg = (attr >> 9) & 0x1ff;
let fg: number | undefined;
if (char) {
const attr: number = char[CHAR_DATA_ATTR_INDEX];
fg = (attr >> 9) & 0x1ff;
}

// Ensure the link is valid before registering
if (matcher.validationCallback) {
Expand Down

0 comments on commit f9717bc

Please sign in to comment.