]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Never add "null" in ForeachStatement.get_defined_variables() c24a807efe5f06e04d6839a48521730d20769045
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 19 Feb 2020 06:36:30 +0000 (07:36 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 19 Feb 2020 06:46:15 +0000 (07:46 +0100)
See https://gitlab.gnome.org/GNOME/vala/issues/911

vala/valaforeachstatement.vala

index 67063bbe1759151cc76ae7203e753bfb07af75e1..5159c2b3f2679300c09ccb3d3e0041df60721c69 100644 (file)
@@ -410,6 +410,8 @@ public class Vala.ForeachStatement : Block {
        }
 
        public override void get_defined_variables (Collection<Variable> collection) {
-               collection.add (element_variable);
+               if (element_variable != null) {
+                       collection.add (element_variable);
+               }
        }
 }