Skip to content

get_profile_field doesn't handle null in the response. #2360

@pixlwave

Description

@pixlwave

Describe the bug
I came across this while debugging an issue on Element X: Using get_profile_field for the AvatarUrl was failing to decode the response when encountering null. The server response for the failing call is {"avatar_url":null}. I've opened a PR to work around this in the Rust SDK by using the deprecated get_avatar_url request as that one does handle null values:

matrix-org/matrix-rust-sdk#6148

How to Reproduce
Using the Rust SDK before matrix-org/matrix-rust-sdk#6148 is merged, call Account::set_avatar_url with None and then call Account:get_avatar_url.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions