Skip to content

Index out of range error #34

@pmpBear

Description

@pmpBear

I had a problem with your plugin today.
Suddenly it stopped working returning an error about an index out of range.

I've figured out that the problem is that the YT api value "total results" returns an approximation, therefore you can't use it as the max value of a for loop.

Check the documentation here:
https://developers.google.com/youtube/v3/docs/search/list

In my case I had 13 videos, but the total results value was 14.

So, in your plugin you should replace all the occurrences of jsonData['pageInfo']['totalResults'] with Jason data['items'].length

Hope this helps!

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