Don't assume notable types are returned by Suggest

Freebase Suggest doesn't always return a notable key in its dictionary,
so we need to check whether it exits.  Fixes issue #636
This commit is contained in:
Tom Morris 2012-11-20 14:03:35 -05:00
parent 14c04698e3
commit 6315036c82

View File

@ -326,13 +326,17 @@ DataTableCellUI.prototype._searchForMatch = function(suggestOptions) {
var match = null;
var commit = function() {
if (match !== null) {
var notable_types = null;
if (match.notable) {
notable_types = $.map(match.notable, function(elmt) {
return typeof elmt == "string" ? elmt : elmt.id;
}).join(",");
}
var params = {
judgment: "matched",
id: match.id,
name: match.name,
types: $.map(match.notable, function(elmt) {
return typeof elmt == "string" ? elmt : elmt.id;
}).join(",")
types: notable_types
};
if (elmts.radioSimilar[0].checked) {