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 6fc6ed7bd9
commit 6f2ec6f33a
2 changed files with 2 additions and 2 deletions

View File

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

View File

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