]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Method representing a LambdaExpression might be null on an error
authorPrinceton Ferro <princetonferro@gmail.com>
Wed, 19 Feb 2020 13:43:00 +0000 (14:43 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 19 Feb 2020 14:17:24 +0000 (15:17 +0100)
This caused criticals like:

  vala_method_get_closure: assertion 'self != NULL' failed

vala/valalambdaexpression.vala

index 4fb7f4564219258ff4f1764acd581586377e6758..314bfa7ce90cbc0f13b9b67883bca2032bd55859 100644 (file)
@@ -249,7 +249,7 @@ public class Vala.LambdaExpression : Expression {
 
        public override void get_used_variables (Collection<Variable> collection) {
                // require captured variables to be initialized
-               if (method.closure) {
+               if (method != null && method.closure) {
                        method.get_captured_variables ((Collection<LocalVariable>) collection);
                }
        }