angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.29k stars 6.73k forks source link

Check for altInputFormats to be defined and an array before using it #6511

Open gigadie opened 7 years ago

gigadie commented 7 years ago

If the user wrongly sets a property which is undefined for the attribute alt-input-formats, this will cause an exception to be thrown when evaluating the viewValue in the method parseDateString.

"Cannot read property 'length' of undefined".

Checking for its existence and if it's an array or not prevents the exception.