Skip to content

Commit 00d4b70

Browse files
committed
Handle cases with no uploadRow or no downloadRow.
1 parent 8655ff9 commit 00d4b70

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jquery.fileupload-ui.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 4.4
2+
* jQuery File Upload User Interface Plugin 4.4.1
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -166,7 +166,10 @@
166166
};
167167

168168
this.replaceNode = function (oldNode, newNode, callBack) {
169-
if (oldNode && newNode) {
169+
if (!(newNode && newNode.length)) {
170+
return uploadHandler.removeNode(oldNode, callBack);
171+
}
172+
if (oldNode && oldNode.length) {
170173
oldNode.fadeOut(function () {
171174
newNode.css('display', 'none');
172175
oldNode.replaceWith(newNode);
@@ -397,7 +400,8 @@
397400
};
398401
multiLoader.push(Array.prototype.slice.call(arguments, 1));
399402
handler.initDownloadRow(event, files, index, xhr, handler);
400-
if (uploadTable && (!downloadTable || uploadTable.get(0) === downloadTable.get(0))) {
403+
if (uploadTable && handler.uploadRow && handler.uploadRow.length &&
404+
(!downloadTable || uploadTable.get(0) === downloadTable.get(0))) {
401405
handler.replaceNode(handler.uploadRow, handler.downloadRow, callBack);
402406
} else {
403407
handler.removeNode(handler.uploadRow, function () {

0 commit comments

Comments
 (0)