Yicong-Huang commented on code in PR #8155:
URL: https://github.com/apache/texera/pull/8155#discussion_r3911019129


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/hub/EntityTables.scala:
##########
@@ -69,6 +71,7 @@ object EntityTables {
 
   def apply(entityType: EntityType): EntityTableSet =
     entityType match {
+      case null                => throw new BadRequestException("Missing 
entityType")

Review Comment:
   The new case asserts `EntityTables(null)` throws 
(`EntityTablesSpec.scala:114-117`) — correct, and it does fail if this guard is 
reverted. But #8154 reports an *endpoint* returning 500, and `HubResourceSpec` 
already has both halves of that pattern: a `"getCount"` block at :574 and an 
endpoint rejection case at :646-651 using the same 
`intercept[BadRequestException]`.
   
   Two lines there — `hub.getCount(null)` and `hub.getTops(null, null, null, 
null)` — would pin the bug at the layer it was reported at, and would cover 
`getTops`, whose 500 → 400 move nothing currently guards.
   
   Additive only: the shipped guard is correct. This strengthens what a future 
edit can break without noticing.



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