Skip to content

Commit 6a0bdb7

Browse files
committed
Bug fix: properties from the Object prototype was leaking into the keywords dictionary in toPng.
1 parent e871825 commit 6a0bdb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/canvas.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ Canvas.prototype.toPng = function Canvas_toPng(keywords) {
108108

109109
if (keywords) {
110110
for (var key in keywords) {
111-
png.writeTextualData(key, keywords[key]);
111+
if (keywords.hasOwnProperty(key)) {
112+
png.writeTextualData(key, keywords[key]);
113+
}
112114
}
113115
}
114116

0 commit comments

Comments
 (0)