damccorm commented on code in PR #35394:
URL: https://github.com/apache/beam/pull/35394#discussion_r2161608923


##########
examples/java/src/main/java/org/apache/beam/examples/complete/datatokenization/utils/SchemasUtils.java:
##########
@@ -88,13 +87,16 @@ private void parseJson(String jsonSchema) throws 
UnsupportedOperationException {
     jsonBeamSchema = BigQueryHelpers.toJsonString(schema.getFields());
   }
 
-  @SuppressFBWarnings("DCN_NULLPOINTER_EXCEPTION")
   private void validateSchemaTypes(TableSchema bigQuerySchema) {
+    if (bigQuerySchema == null) {
+      LOG.error("Provided BigQuery schema is null. Please check your input.");
+      return;
+    }
     try {
       beamSchema = fromTableSchema(bigQuerySchema);
     } catch (UnsupportedOperationException exception) {
       LOG.error("Check json schema, {}", exception.getMessage());
-    } catch (NullPointerException npe) {
+    } catch (Exception e) {

Review Comment:
   We should probably still catch the NPE, and then we can separately catch 
`Exception` and log an error with the exception details.



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to