Skip to content

Commit 97678c7

Browse files
author
millenaarg
committed
Update cell.js (#1)
When invoking the jsPDF.table() method a "TypeError: config.css is undefined" is thrown when there is no font-size property on the css property of the config object that is passed. In this case execution halts. Added check for config.css and config.css['font-size']. Used a negative typeof check for "undefined" instead of a positive one for "number" to respect loose typing.
1 parent 5f00080 commit 97678c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/cell.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
if(config.fontSize){
236236
fontSize = config.fontSize;
237237
}
238-
if (config.css['font-size']) {
238+
if (config.css && typeof(config.css['font-size']) !== "undefined") {
239239
fontSize = config.css['font-size'] * 16;
240240
}
241241
if(config.margins){

0 commit comments

Comments
 (0)