Skip to content

Commit 4301e73

Browse files
committed
validate only string colors #2872
1 parent b2cc389 commit 4301e73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PDFDocument.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class PDFDocument extends PDFKit {
173173
color = color || defaultColor;
174174

175175
if (typeof this._normalizeColor === 'function') {
176-
if (this._normalizeColor(color) === null) { // color is not valid
176+
if (isString(color) && this._normalizeColor(color) === null) { // color is not valid
177177
return defaultColor;
178178
}
179179
}

0 commit comments

Comments
 (0)