Skip to content

LoaderItem urlVariables #11

@jesperstarkar

Description

@jesperstarkar

Line 89: var data:URLVariables = new URLVariables( ((request.data is URLVariables) ? request.data.toString() : null) );

A problem occurs if request.data is null or an empty URLVariables object. This happens if you assign a URLVariables object to the URLRequest of the Loader(item), with no parameters passed into it.

.toString() renders an empty string which in URLVariables.decoderesults in an error thrown.

My suggestion is to keep the existing URLVariables object if present, or create a new one from parsing arbitrary data if not:
var data:URLVariables = (request.data is URLVariables) : request.data : new URLVariables(request.data.toString());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions