Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 4c47b27

Browse files
StefanFeederleThomasBurleson
authored andcommitted
fix(chips): safety check before getting length
If the model is not yet filled (ajax?) this functions fails with: TypeError: Cannot read property 'length' of undefined Ported the fix from: sime/ui-select@1edc16b Closes #6175
1 parent 7c6ff36 commit 4c47b27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/chips/js/chipsController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ MdChipsCtrl.prototype.chipKeydown = function (event) {
213213
*/
214214
MdChipsCtrl.prototype.getPlaceholder = function() {
215215
// Allow `secondary-placeholder` to be blank.
216-
var useSecondary = (this.items.length &&
216+
var useSecondary = (this.items && this.items.length &&
217217
(this.secondaryPlaceholder == '' || this.secondaryPlaceholder));
218218
return useSecondary ? this.secondaryPlaceholder : this.placeholder;
219219
};

0 commit comments

Comments
 (0)