Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty "tags" object #1

Closed
nielsvanrijn opened this issue Sep 30, 2020 · 1 comment
Closed

Empty "tags" object #1

nielsvanrijn opened this issue Sep 30, 2020 · 1 comment

Comments

@nielsvanrijn
Copy link

On line 84 of index.html
info.tags gets checked with an if(){} statement, in my case my tags object was empty like so

"tags":{}

The if(){} returns true because an empty JavaScript object is a truthy value. This causes the for loop on line 85 to throw an error because it can't iterate.

The fix (I think would be best) is to check for the length of keys in the object.

if (Object.keys(info.tags).length > 0) {
//
}
@Palats
Copy link
Owner

Palats commented Sep 30, 2020

Thanks for the report! I'll probably submit a fix & release a new version later today. Also, it is probably a sign that the project grew enough to have more formal testing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants