Make sure link_entry & file_upload are still present before trying to destroy them.

Fixes hidden error when calling etemplate2.clear() with read-only link widgets.
This commit is contained in:
Ralf Becker 2015-07-27 17:26:31 +00:00
parent ed9204103c
commit 03d3f7924f

View File

@ -96,10 +96,16 @@ var et2_link_to = et2_inputWidget.extend(
this.link_button = null;
this.status_span = null;
if(this.link_entry)
{
this.link_entry.destroy();
this.link_entry = null;
}
if(this.file_upload)
{
this.file_upload.destroy();
this.file_upload = null;
}
this.div = null;
this._super.apply(this, arguments);