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


##########
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:
   I suggest leaving things as is for now, as this is the quickest fix and 
Spotbugs may fail due to catching NPE.



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