Skip to content

Commit

Permalink
WAR for a possible npe issue
Browse files Browse the repository at this point in the history
Signed-off-by: Firestarman <[email protected]>
  • Loading branch information
firestarman committed May 15, 2024
1 parent 9ce9b12 commit 42fed9f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ private class GpuColumnarBatchSerializerInstance(dataSize: GpuMetric, serTime: G
with Logging {
private[this] val dOut = new DataOutputStream(new BufferedOutputStream(out))
private[this] val tableSerializer = new SimpleTableSerializer()
onTaskCompletion(TaskContext.get())(tableSerializer.close())
Option(TaskContext.get()).foreach { tc =>
onTaskCompletion(tc)(tableSerializer.close())
}

private lazy val serializeBatch: ColumnarBatch => Unit = if (isSerializedTable) {
serializeGpuBatch
Expand Down

0 comments on commit 42fed9f

Please sign in to comment.