Skip to content

Commit

Permalink
Fix potential bug
Browse files Browse the repository at this point in the history
Fix a potential bug that can occur when the user creates a custom coroutine type
  • Loading branch information
Inspiaaa committed Sep 10, 2024
1 parent 0f9eb10 commit 323186f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/HCoroutines/src/CoroutineBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public class CoroutineBase

public void StartCoroutine(CoroutineBase coroutine)
{
if (!IsAlive)
{
throw new InvalidOperationException("Cannot start child coroutine on dead parent coroutine.");
}

coroutine.Manager = Manager;
coroutine.Parent = this;

Expand Down

0 comments on commit 323186f

Please sign in to comment.