[vala/0.40] 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.40] vala: Never add "null" in ForeachStatement.get_defined_variables()
- Date: Thu, 5 Mar 2020 18:44:53 +0000 (UTC)
commit 6b3ff00b9e47bb910a736d21eaa6925a8a302889
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 4de3f52bd..836a67651 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -405,6 +405,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]