Skip to content

ArrayIndexOutOfBoundsException on Structure#toArray(0) #496

@mintern

Description

@mintern

array[0] = this;
assumes that the array has at least one element, but this is not true when the array is empty.

I would submit a Pull Request, but I'm not sure if the preference would be to add an array.length > 0 check around array[0] = this, or to simply add if (array.length == 0) return array; to the top of the method.

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