diff --git a/modules/plugins/flexboxIE.js b/modules/plugins/flexboxIE.js index d7e7479..37bc09b 100644 --- a/modules/plugins/flexboxIE.js +++ b/modules/plugins/flexboxIE.js @@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).reduce((result, prop) => { export default function flexboxIE({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) { if ( - (properties[property] || property === 'display' && value.indexOf('flex') > -1) && + (properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) && ( (browser === 'ie_mob' || browser === 'ie') && version == 10) ) { diff --git a/modules/plugins/flexboxOld.js b/modules/plugins/flexboxOld.js index 9357dda..2fa2c24 100644 --- a/modules/plugins/flexboxOld.js +++ b/modules/plugins/flexboxOld.js @@ -26,7 +26,7 @@ const properties = Object.keys(alternativeProps).concat(otherProps).reduce((resu export default function flexboxOld({ property, value, styles, browserInfo: { browser, version }, prefix: { css }, keepUnprefixed }) { if ( - (properties[property] || property === 'display' && value.indexOf('flex') > -1) && + (properties[property] || property === 'display' && typeof value==='string' && value.indexOf('flex') > -1) && ( browser === 'firefox' && version < 22 || browser === 'chrome' && version < 21 || diff --git a/test/prefixer-test.js b/test/prefixer-test.js index 0909db9..890f1ea 100644 --- a/test/prefixer-test.js +++ b/test/prefixer-test.js @@ -340,6 +340,14 @@ describe('Prefixing display', () => { display: 'block' })).to.eql({ display: 'block' }) }) + it('should not throw if display is null or undefined', () => { + expect(new Prefixer({ userAgent: Chrome45 }).prefix({ + display: null + })).to.eql({ display: null }) + expect(new Prefixer({ userAgent: Chrome45 }).prefix({ + display: undefined + })).to.eql({ display: undefined }) + }) }) describe('Using Prefixer.prefixAll', () => {