Skip to content

Null Metadata Field Causing Confluence 500 Internal Service Error #64

@dimaliok

Description

@dimaliok

Describe the bug
When updating a page using the UpdateContent() function, with content.MetaData unset, Confluence returns a 500 Internal Service Error with the following message in debug mode:
{"statusCode":500,"message":"java.lang.NullPointerException: Cannot invoke \"java.util.Map.size()\" because \"<parameter1>\" is null"}

Looking at the outputted request json, I see a "metadata":null field. It appears the confluence API doesn't handle null fields well, so there should probably be an "omitempty" in the Metadata struct.
To Reproduce
Steps to reproduce the behavior:
Send a curl request to the confluence api with the metadata field being null. Or use UpdateContent with the metadata field unset.

Expected behavior
Update to be successful instead of returning a 500 error.

Release version
1.4.6

Additional context
Possibly related to #59

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