From 770924ca8d82f13839964df18734f4168819e122 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sun, 9 Sep 2012 19:06:14 -0700 Subject: [PATCH] Fix empty Select2 input from throwing an error when attempting to selecting a value. --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 44d0e924..0840fb90 100755 --- a/select2.js +++ b/select2.js @@ -2361,7 +2361,7 @@ return markup.join(""); }, formatSelection: function (data, container) { - return data.text; + return data ? data.text : undefined; }, formatResultCssClass: function(data) {return undefined;}, formatNoMatches: function () { return "No matches found"; },