Permalink
Browse files

sanity checks in combo box

  • Loading branch information...
1 parent fd21489 commit bde9989d4ba662752e94da0dbfd6db617639feeb Mihai Man committed with etgryphon Apr 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 frameworks/foundation/views/combo_box.js
@@ -890,9 +890,9 @@ SCUI.ComboBoxView = SC.View.extend( SC.Control, SC.Editable, {
if (lv && len === 1) {
var filter = this.get('filter'),
obj = lv.getPath('content').objectAt(0),
- value = this._getObjectName(obj, this.get('nameKey'));
+ value = obj.get ? obj.get(this.get('nameKey')) : obj[this.get('nameKey')];
- if (filter && (value.toLowerCase() === filter.toLowerCase())) {
+ if (filter && value && (value.toLowerCase() === filter.toLowerCase())) {
selection = obj;
}
}

0 comments on commit bde9989

Please sign in to comment.