From f504a8706e91d9f817a834ee5b89c9a341a2ff35 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 7 Dec 2018 15:17:24 +0100 Subject: [PATCH] Fix null reference error in evaluator --- Upsilon/Evaluator/Evaluator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Upsilon/Evaluator/Evaluator.cs b/Upsilon/Evaluator/Evaluator.cs index e11defe..d748d4c 100644 --- a/Upsilon/Evaluator/Evaluator.cs +++ b/Upsilon/Evaluator/Evaluator.cs @@ -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"); }