Skip to content

Commit 03bda1b

Browse files
author
Praful Makani
authored
fix: nullpointer exception when executionerror is null (#754)
1 parent 7258ada commit 03bda1b

File tree

1 file changed

+4
-2
lines changed
  • google-cloud-bigquery/src/main/java/com/google/cloud/bigquery

1 file changed

+4
-2
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ public TableResult getQueryResults(QueryResultsOption... options)
297297
job = reload();
298298
}
299299
if (job.getStatus() != null && job.getStatus().getError() != null) {
300-
throw new JobException(
301-
getJobId(), ImmutableList.copyOf(job.getStatus().getExecutionErrors()));
300+
throw new BigQueryException(
301+
job.getStatus().getExecutionErrors() == null
302+
? ImmutableList.of(job.getStatus().getError())
303+
: ImmutableList.copyOf(job.getStatus().getExecutionErrors()));
302304
}
303305

304306
// If there are no rows in the result, this may have been a DDL query.

0 commit comments

Comments
 (0)