justinmclean commented on code in PR #6573:
URL: https://github.com/apache/gravitino/pull/6573#discussion_r1976526892


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListCatalogProperties.java:
##########
@@ -50,18 +50,30 @@ public ListCatalogProperties(CommandContext context, String 
metalake, String cat
   @Override
   public void handle() {
     Catalog gCatalog = null;
-    try {
-      GravitinoClient client = buildClient(metalake);
+
+    try (GravitinoClient client = buildClient(metalake)) { // Ensures client 
is closed
       gCatalog = client.loadCatalog(catalog);
     } catch (NoSuchMetalakeException err) {
       exitWithError(ErrorMessages.UNKNOWN_METALAKE);
+      return;
     } catch (NoSuchCatalogException err) {
       exitWithError(ErrorMessages.UNKNOWN_CATALOG);
+      return;
     } catch (Exception exp) {
       exitWithError(exp.getMessage());
+      return;
+    }
+
+    if (gCatalog == null) { // Null check before accessing properties

Review Comment:
   there is no need for comments like "// Null check before accessing 
properties"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to