From: Rico Tzschichholz Date: Wed, 19 Feb 2020 06:36:30 +0000 (+0100) Subject: vala: Never add "null" in ForeachStatement.get_defined_variables() X-Git-Tag: 0.47.92~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fkeep-around%2Fc24a807efe5f06e04d6839a48521730d20769045;p=thirdparty%2Fvala.git vala: Never add "null" in ForeachStatement.get_defined_variables() See https://gitlab.gnome.org/GNOME/vala/issues/911 --- 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); + } } }