Skip to content

Commit 0c479b4

Browse files
committed
additional tweal to select2#1528 to make formatters skip nulls
1 parent 99dbc66 commit 0c479b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

select2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,9 @@ the specific language governing permissions and limitations under the Apache Lic
22062206
this.selection.data("select2-data", data);
22072207

22082208
container.empty();
2209-
formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
2209+
if (data !== null) {
2210+
formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
2211+
}
22102212
if (formatted !== undefined) {
22112213
container.append(formatted);
22122214
}

0 commit comments

Comments
 (0)