Skip to content

Presence breaks after receiving invalid JSON response #8

Description

@Hpmason

If server query returns an invalid JSON response, the program panics. Other commands will still work, but the presence will stop updating.

missing field `version` at line 1 column 2
invalid JSON response: "{}"
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/handler.rs:80:61
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This error originates from

for player in status.players.sample.unwrap() {

Fix should handle None case to avoid panic

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions