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

fails loading, if a pack has zero stickers #64

Open
LuckyTurtleDev opened this issue Aug 25, 2023 · 0 comments
Open

fails loading, if a pack has zero stickers #64

LuckyTurtleDev opened this issue Aug 25, 2023 · 0 comments

Comments

@LuckyTurtleDev
Copy link

Stickerpicker fails loading, if a pack has zero stickers:

Uncaught (in promise) TypeError: pack.stickers[0] is undefined
    NavBarItem https://ptphoenix.github.io/stickerpicker/web/src/index.js:339
    Preact 16
    _loadPacks https://ptphoenix.github.io/stickerpicker/web/src/index.js:179
    _loadPacks https://ptphoenix.github.io/stickerpicker/web/src/index.js:157
    componentDidMount https://ptphoenix.github.io/stickerpicker/web/src/index.js:190
    Preact 4
    <anonymous> https://ptphoenix.github.io/stickerpicker/web/src/index.js:363
index.js:339:1
<img src=${makeThumbnailURL(pack.stickers[0].url)}
					alt=${pack.stickers[0].body} class="visible" />

This caused also that the picker stop loading the remain packs.

I would recommend using the java script version of:

pack.stickers.first().unwrap_or("not_found.png")

However assuming that a pack is not empty is justify, but it should not effect the other stickerpacks.

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

1 participant