Ensure select2 instances have a destroy property before calling destroy.

This commit is contained in:
Surinder Kumar 2016-10-21 16:16:10 +01:00 committed by Dave Page
parent 2952faab5e
commit 19bd021696

View File

@ -1894,7 +1894,8 @@
].join("\n")),
render: function() {
if(this && this.$sel && this.$sel.select2) {
if(this.$sel && this.$sel.select2 &&
this.$sel.select2.hasOwnProperty('destroy')) {
this.$sel.select2('destroy');
}