[vala/staging] vala: Never add "null" in ForeachStatement.get_defined_variables()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Never add "null" in ForeachStatement.get_defined_variables()
- Date: Wed, 19 Feb 2020 06:55:39 +0000 (UTC)
commit c24a807efe5f06e04d6839a48521730d20769045
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Feb 19 07:36:30 2020 +0100
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<Variable> collection) {
- collection.add (element_variable);
+ if (element_variable != null) {
+ collection.add (element_variable);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]