From 0c479b4cd1dc868f668d308c39077596e1ee0048 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 17 Jul 2013 00:32:41 -0700 Subject: [PATCH] additional tweal to #1528 to make formatters skip nulls --- select2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 2217f0c4..4d91bca3 100644 --- a/select2.js +++ b/select2.js @@ -2206,7 +2206,9 @@ the specific language governing permissions and limitations under the Apache Lic this.selection.data("select2-data", data); container.empty(); - formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + if (data !== null) { + formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + } if (formatted !== undefined) { container.append(formatted); }