Skip to content

Commit 8d786ae

Browse files
committed
Fix panic
1 parent b34ea29 commit 8d786ae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/function/execute.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,11 @@ where
256256
// transfer it to the outermost cycle head (if any). This prevents any other thread
257257
// from claiming this query (all cycle heads are potential entry points to the same cycle),
258258
// which would result in them competing for the same locks (we want the locks to converge to a single cycle head).
259-
claim_guard.set_release_mode(ReleaseMode::TransferTo(
260-
outer_cycle.expect("query to of an outer cycle."),
261-
));
259+
if let Some(outer_cycle) = outer_cycle {
260+
claim_guard.set_release_mode(ReleaseMode::TransferTo(outer_cycle));
261+
} else {
262+
claim_guard.set_release_mode(ReleaseMode::SelfOnly);
263+
}
262264

263265
completed_query.revisions.set_cycle_heads(cycle_heads);
264266
break (new_value, completed_query);

0 commit comments

Comments
 (0)