Skip to content

Commit ee6e75e

Browse files
committed
remove defensive null checks
1 parent 83d78f8 commit ee6e75e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ ExecuteResult executeJob(QueryJobConfiguration jobConfiguration)
603603
}
604604

605605
private StatementType getStatementType(ExecuteResult executeResult) {
606-
if (executeResult.tableResult != null && executeResult.tableResult.getStatementType() != null) {
606+
if (executeResult.tableResult.getStatementType() != null) {
607607
return executeResult.tableResult.getStatementType();
608608
}
609609
if (executeResult.job != null && executeResult.job.getStatistics() instanceof QueryStatistics) {
@@ -717,7 +717,7 @@ void handleQueryResult(String query, TableResult results, SqlType queryType, Job
717717
case DML:
718718
case DML_EXTRA:
719719
Long dmlRowCount;
720-
if (results != null && results.getNumDmlAffectedRows() != null) {
720+
if (results.getNumDmlAffectedRows() != null) {
721721
dmlRowCount = results.getNumDmlAffectedRows();
722722
} else {
723723
QueryStatistics dmlStats = getQueryStatisticsFromJob(results, job);
@@ -785,7 +785,7 @@ private QueryStatistics getQueryStatisticsFromJob(TableResult results, Job job)
785785
throws SQLException {
786786
try {
787787
Job activeJob = job;
788-
if (activeJob == null) {
788+
if (activeJob == null && results.getJobId() != null) {
789789
activeJob = this.bigQuery.getJob(results.getJobId());
790790
}
791791
Job completedJob = (activeJob != null) ? activeJob.waitFor() : null;

0 commit comments

Comments
 (0)