Skip to content

Fix PartitionKey.None.toString() throws an exception #9053

@FredGao-new

Description

@FredGao-new

#8499

PartitionKey.None.toString() throws an exception:

Java: 11

Jackson: 2.10.1

azure-cosmos 3.6.0

    @Test 
    void testPartitionKeyNoneToString() { 
        com.azure.data.cosmos.PartitionKey.None.toString(); 
    } 

The exception happened in the following code:

for (IPartitionKeyComponent componentValue : partitionKey.getComponents()) {

partitionKey.getComponents() return null in the "for" loop.

Is it ok to add a null check for partitionKey.getComponents before the for loop?

@jongio

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.CosmosbugThis issue requires a change to an existing behavior in the product in order to be resolved.cosmos:v4-itemIndicates this feature will be shipped as part of V4 release train

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions