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


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListSchemaProperties.java:
##########
@@ -54,10 +54,16 @@ public ListSchemaProperties(
   /** List the properties of a schema. */
   @Override
   public void handle() {
-    Schema gSchema = null;
-    try {
-      GravitinoClient client = buildClient(metalake);
-      gSchema = client.loadCatalog(catalog).asSchemas().loadSchema(schema);
+    try (GravitinoClient client = buildClient(metalake)) { // Ensure resource 
cleanup
+      Schema gSchema = 
client.loadCatalog(catalog).asSchemas().loadSchema(schema);
+
+      if (gSchema == null) {
+        exitWithError("Schema not found: " + schema);
+        return;
+      }
+
+      Map<String, String> properties = gSchema.properties();
+      printProperties(properties);

Review Comment:
   please move the line back to wher ethey were adn do the null check outside 
of the try block



-- 
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