This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 0f2a9fd378 [#8291] In OwnerDetails.java exit if entity type is null 
(#8320)
0f2a9fd378 is described below

commit 0f2a9fd378dcd76615f8dc2a957199192bfdf8a3
Author: Aamir <[email protected]>
AuthorDate: Fri Aug 29 03:34:43 2025 +0530

    [#8291] In OwnerDetails.java exit if entity type is null (#8320)
    
    ### Summary
    Fixes issue #8291 by adding a null-check for entityType in
    OwnerDetails.java.
    
    ### Details
    - Added validation so the command exits early if entityType is null.
    - Verified with existing test:
    testHandle_withoutValidate_shouldExitWithUnknownEntity.
    - No new tests added, since coverage already exists.
    
    ### Notes
    - Ran tests locally, all passed.
---
 .../src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java 
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java
index 8ec542a581..d1ee023825 100644
--- 
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java
+++ 
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/OwnerDetails.java
@@ -67,6 +67,10 @@ public class OwnerDetails extends Command {
   /** Displays the owner of an entity. */
   @Override
   public void handle() {
+    if (entityType == null) {
+      exitWithError(ErrorMessages.UNKNOWN_ENTITY);
+    }
+
     Optional<Owner> owner = Optional.empty();
     MetadataObject metadata = MetadataObjects.parse(entity, entityType);
 

Reply via email to