Throw error if for some reason the execution of a statement in a coroutine returns null
This commit is contained in:
parent
72623036a8
commit
02fb3867e1
|
@ -39,6 +39,11 @@ namespace Upsilon.Binder
|
|||
foreach (var statement in Statements)
|
||||
{
|
||||
var coroutine = statement.EvaluateCoroutine(scope, diagnostics, state);
|
||||
if (coroutine == null)
|
||||
{
|
||||
diagnostics.LogError("Can't evaluate a statement, it returned nil.", statement.Span);
|
||||
continue;
|
||||
}
|
||||
while (coroutine.MoveNext())
|
||||
{
|
||||
yield return coroutine.Current;
|
||||
|
|
Loading…
Reference in New Issue