Skip to content

Commit

Permalink
Merge pull request #548 from EWhite613/gaurd
Browse files Browse the repository at this point in the history
Add for autocomplete guard when value is undefined
  • Loading branch information
EWhite613 committed Aug 17, 2018
2 parents bb82f2b + c2c5eaa commit ed940fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/components/inputs/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default SelectInput.extend({
* @param {Array} data - array of items displayed in autocomplete
* @returns {String} selected item label
*/
_findSelectedItemLabelGivenValue (value, data) {
_findSelectedItemLabelGivenValue (value = {}, data) {
let label = getWithDefault(value, 'label', '')
if (typeof value === 'string') {
const foundItem = this._findSelectedItemGivenValue(value, data) || {}
Expand Down

0 comments on commit ed940fa

Please sign in to comment.