Skip to content

Commit

Permalink
Avoid to pass undefined or null object to Object.keys()
Browse files Browse the repository at this point in the history
If css file doesn't has some of those style classes, the "objRule" would be undefined.
  • Loading branch information
kieat committed Oct 2, 2018
1 parent 301eab5 commit a4a55d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -4,7 +4,7 @@ var INDENT = ' '

function inlineRule (objRule) {
var str = ''
Object.keys(objRule).forEach(function (rule) {
objRule && Object.keys(objRule).forEach(function (rule) {
str += rule + ':' + objRule[rule] + ';'
})
return str
Expand Down

0 comments on commit a4a55d3

Please sign in to comment.