jerryshao commented on code in PR #12770:
URL: https://github.com/apache/gravitino/pull/12770#discussion_r3901561384
##########
server/src/main/java/org/apache/gravitino/server/web/rest/ViewOperations.java:
##########
@@ -99,15 +99,23 @@ public Response createView(
@PathParam("catalog") String catalog,
@PathParam("schema") String schema,
ViewCreateRequest request) {
- LOG.info(
- "Received create view request: {}.{}.{}.{}", metalake, catalog,
schema, request.getName());
+ if (request == null) {
+ LOG.warn("Received create view request with null request body");
+ return ExceptionHandlers.handleViewException(
+ OperationType.CREATE,
+ "",
+ schema,
+ new IllegalArgumentException("Request body cannot be null"));
+ }
+
+ String viewName = request.getName();
Review Comment:
Name can also be null before validation. You'd better also check nullable
before logging.
--
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]