Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
Don't convert a color if parsing failed
Browse files Browse the repository at this point in the history
See #39. This does not fix completely, but suppress an runtime error.
  • Loading branch information
Kyo Nagashima committed Oct 18, 2014
1 parent 36c7333 commit 353da56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/csswring.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ var unquoteFontFamily = function (family) {
var toRGBColor = function (m, leading, color) {
color = onecolor(color);

// one.color failed to parse `color`
if (!color) {
return m;
}

if (color.alpha() < 1) {
return leading + color.cssa();
}
Expand Down

0 comments on commit 353da56

Please sign in to comment.