Fix null reference error in evaluator

This commit is contained in:
Deukhoofd 2018-12-07 15:17:24 +01:00
parent b0450d3bf5
commit f504a8706e
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 5 additions and 1 deletions

View File

@ -632,7 +632,11 @@ namespace Upsilon.Evaluator
while (enumerator.MoveNext())
{
var current = enumerator.Current;
if (current == null || current.Type != Type.Table)
if (current == null)
{
throw new Exception($"Can't assign result value of nothing to multiple values");
}
if (current.Type != Type.Table)
{
throw new Exception($"Can't assign result value with type '{current.Type}' to multiple values");
}