Make sure sender object is there before using it

This commit is contained in:
Hadi Nategh 2020-10-19 16:06:22 +02:00
parent b0d55160a3
commit 5288e3a0fd
2 changed files with 2 additions and 2 deletions

View File

@ -872,7 +872,7 @@ var et2_vfsUpload = /** @class */ (function (_super) {
return true;
};
et2_vfsUpload.prototype.getDOMNode = function (sender) {
if (sender !== this && sender._type.indexOf('vfs') >= 0) {
if (sender && sender !== this && sender._type.indexOf('vfs') >= 0) {
var value = sender.getValue && sender.getValue() || sender.options.value || {};
var row = jQuery("[data-path='" + (value.path.replace(/'/g, '&quot')) + "']", this.list);
if (sender._type === 'vfs-mime') {

View File

@ -1001,7 +1001,7 @@ class et2_vfsUpload extends et2_file
}
getDOMNode(sender) {
if(sender !== this && sender._type.indexOf('vfs') >= 0 )
if(sender && sender !== this && sender._type.indexOf('vfs') >= 0 )
{
var value = sender.getValue && sender.getValue() || sender.options.value || {};
var row = jQuery("[data-path='"+(value.path.replace(/'/g, '&quot'))+"']",this.list);