Skip to content

Commit

Permalink
Merge pull request #1238 from alegag/develop
Browse files Browse the repository at this point in the history
Fixes "Cannot read property '1' of null"
  • Loading branch information
Alex-D authored Jul 27, 2021
2 parents ad59127 + 3ffbeef commit fd304a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/colors/trumbowyg.colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
return 'transparent';
} else {
rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d?(.\d+)))?\)$/);
if (rgb == null) {
return 'transparent'; // No match, return transparent as unkown color
}
return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
}
Expand Down

0 comments on commit fd304a3

Please sign in to comment.