From c24a807efe5f06e04d6839a48521730d20769045 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Wed, 19 Feb 2020 07:36:30 +0100 Subject: [PATCH] vala: Never add "null" in ForeachStatement.get_defined_variables() See https://gitlab.gnome.org/GNOME/vala/issues/911 --- vala/valaforeachstatement.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index 67063bbe1..5159c2b3f 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -410,6 +410,8 @@ public class Vala.ForeachStatement : Block { } public override void get_defined_variables (Collection collection) { - collection.add (element_variable); + if (element_variable != null) { + collection.add (element_variable); + } } } -- 2.47.2