Can't handle `undefined` value
See original GitHub issueHello, when value is set to undefined, the console show these messages:
vue.common.js?e881:1019 [Vue warn]: Error when evaluating expression "function (){return this.multiple?this.value.slice(0,this.limit):this.value}": TypeError: Cannot read property 'slice' of undefined (found in component: <multiselect>)warn @ vue.common.js?e881:1019Watcher.get @ vue.common.js?e881:3176Watcher.evaluate @ vue.common.js?e881:3356computedGetter @ vue.common.js?e881:8035(anonymous function) @ VM46429:3Watcher.get @ vue.common.js?e881:3173Watcher.run @ vue.common.js?e881:3314runBatcherQueue @ vue.common.js?e881:3071flushBatcherQueue @ vue.common.js?e881:3041nextTickHandler @ vue.common.js?e881:445
vue.common.js?e881:1019 [Vue warn]: Error when evaluating expression "multiple && max === value.length": TypeError: Cannot read property 'length' of undefined (found in component: <multiselect>)warn @ vue.common.js?e881:1019Watcher.get @ vue.common.js?e881:3176Watcher.run @ vue.common.js?e881:3314runBatcherQueue @ vue.common.js?e881:3071flushBatcherQueue @ vue.common.js?e881:3041nextTickHandler @ vue.common.js?e881:445
vue.common.js?e881:1019 [Vue warn]: Error when evaluating expression "!max || value.length < max": TypeError: Cannot read property 'length' of undefined (found in component: <multiselect>)
A simple check to convert undefined to an empty array could be an easy solution, no ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Cannot Read Property of Undefined in JavaScript - Rollbar
What Causes TypeError: Cannot Read Property of Undefined. Undefined means that a variable has been declared but has not been assigned a value....
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
Read more >7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
A detailed article about 'undefined' keyword in JavaScript. 7 tips on how to handle correctly 'undefined' and increase code durability.
Read more >[Solved] Cannot read Properties of Undefined in JavaScript
The 'Cannot read properties of undefined' error occurs when you try to access a property or a method on a variable that stores...
Read more >How to Avoid Getting 'Cannot read property of undefined' in ...
One of the most common type errors in JavaScript is the famous "Cannot read property of undefined". This error occurs when you try...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for more details! I will try to look into it this week! 😃
This will be fixed in beta.14 (already on master). Should be published tomorrow.