diff --git a/src/flow/src/batching_mode/task.rs b/src/flow/src/batching_mode/task.rs index a7fa07bcbd..de0e7ed4a4 100644 --- a/src/flow/src/batching_mode/task.rs +++ b/src/flow/src/batching_mode/task.rs @@ -223,10 +223,10 @@ impl BatchingExecutionGuard { impl Drop for BatchingExecutionGuard { fn drop(&mut self) { - if let Some((state, old_ctx)) = self.restore.take() { - if let Ok(mut state) = state.write() { - state.query_ctx = old_ctx; - } + if let Some((state, old_ctx)) = self.restore.take() + && let Ok(mut state) = state.write() + { + state.query_ctx = old_ctx; } } }