nbubna / Case

String case utitility: convert, identify, flip, extend
http://nbubna.github.io/Case/
MIT License
280 stars 26 forks source link

Passing in empty string to sentence function causes error #20

Closed taylortdixon closed 7 years ago

taylortdixon commented 7 years ago

Hi,

Passing in an empty string into the sentenceCase filter generates an error "Unable to get property 'replace' of undefined or null reference".

After stepping thru the code, I believe the culprit is the modifications to the fill functions at this commit https://github.com/nbubna/Case/commit/32894565e966af3bff2beb53ed453753dbcd4415#diff-6f9cd8468dcb32af7249d8e02dd3ab07.

Previously, you would return 's' if !s === true, however in the latest you do not return anything, causing it to return undefined.

-Taylor

nbubna commented 7 years ago

Fixed in v1.5.1

taylortdixon commented 7 years ago

Awesome @nbubna Thank you!