[vala/0.46] vala: Never add "null" in ForeachStatement.get_defined_variables()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.46] vala: Never add "null" in ForeachStatement.get_defined_variables()
- Date: Thu, 5 Mar 2020 18:45:44 +0000 (UTC)
commit 1c484797fd13f24f83b4be8c153c1481b4365642
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]