deluge-extractorplus-plugin icon indicating copy to clipboard operation
deluge-extractorplus-plugin copied to clipboard

TypeError: undefined is not an object (evaluating 'items.length')

Open brandonscript opened this issue 5 months ago • 0 comments

When enabling the plugin, I get a console error TypeError: undefined is not an object (evaluating 'items.length'). It's occuring inside the onApply event:

I set it to break on uncaught exceptions, and:

onApply: function () {
        // Build up config from form values
        var config = {};
        config['extract_path'] = this.extractPath.getValue();
        
        // Initialize all extraction options to false
        config['extract_selected_folder'] = false;
        config['extract_torrent_root'] = false;
        config['extract_in_place'] = false;
        
        // Find which radio button is selected
        var selectedValue = null;
        var items = this.extractBehavior.items.items;

//            ^ items here is undefined

        // ...
    },

Inspecting the values nearby, this.extractBehavior.items is:

Array (3) = 
{boxLabel: "Selected Folder", name: "extract_behavior", inputValue: "extract_selected_folder", checked: false, listeners: Object}
{boxLabel: "Torrent Root", name: "extract_behavior", inputValue: "extract_torrent_root", checked: false, listeners: Object}
{boxLabel: "In-Place", name: "extract_behavior", inputValue: "extract_in_place", checked: false, listeners: Object}
Array Prototype

But of course there's no .items prop on this.

I tried a clean install and deleting the extractorplus.conf/.bak files, but still the same thing occurs.

It appears that this doesn't affect the plugin itself running, but it's affecting other plugins that run after this becuase it's stopping execution on this error.

brandonscript avatar Jul 21 '25 18:07 brandonscript