Browse Source

additional tweal to #1528 to make formatters skip nulls

Igor Vaynberg 11 years ago
parent
commit
0c479b4cd1
1 changed files with 3 additions and 1 deletions
  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);
             this.selection.data("select2-data", data);
 
 
             container.empty();
             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) {
             if (formatted !== undefined) {
                 container.append(formatted);
                 container.append(formatted);
             }
             }