浏览代码

additional tweal to #1528 to make formatters skip nulls

Igor Vaynberg 11 年之前
父节点
当前提交
0c479b4cd1
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      select2.js

+ 3 - 1
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);
             }