Skip to content

[Enhancement] Fix NPE in getAcl when subject is null #9809

@majialoong

Description

@majialoong

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

When the getAcl method receives a null subject (for example, due to incorrect user input or a non-existent subjectType), it currently returns a raw NPE error message. This is not user-friendly. We should avoid NPE and provide a clear, helpful error message instead.

Image

Motivation

Avoid returning raw NPE error messages directly.

Describe the Solution You'd Like

Check whether the subject is null and handle the exception accordingly.This is also similar to other methods in AuthorizationMetadataManagerImpl, such as createAcl and updateAcl.

The improved message prompt is as follows:

Image

Describe Alternatives You've Considered

No

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions