mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 09:39:58 -06:00
Add validation for empty jQuery objects in icon handling
- Check .length === 0 to prevent TypeError on .attr('class')
- Prevents issues when empty jQuery object is passed (e.g., $('.nonexistent'))
This commit is contained in:
@@ -70,8 +70,8 @@ function dfm_footer(action, text, $icon) {
|
||||
// Add icon and text
|
||||
if ($icon && text) {
|
||||
|
||||
// Ensure $icon is a jQuery object
|
||||
if (!($icon instanceof jQuery)) {
|
||||
// Ensure $icon is a jQuery object with elements
|
||||
if (!($icon instanceof jQuery) || $icon.length === 0) {
|
||||
$notice.html(fileManagerIcon + text);
|
||||
break;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ function dfm_showProgress(data) {
|
||||
$dialogContainer.contents().filter(function() {
|
||||
return this.nodeType === 3; // Text nodes only
|
||||
}).remove();
|
||||
|
||||
|
||||
// Remove <br> elements
|
||||
$dialogContainer.find('br').remove();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user