]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Handle unavailable type-symbol in Constant.check_const_type() 4f48a27ac93913667413d42f34a04b25949ee4a9
authorPrinceton Ferro <princetonferro@gmail.com>
Thu, 20 Feb 2020 14:31:13 +0000 (15:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 20 Feb 2020 14:33:03 +0000 (15:33 +0100)
This caused criticals like:

  vala_typesymbol_is_subtype_of: assertion 'self != NULL' failed

vala/valaconstant.vala

index 809cb883dba241133afe6e4ffe49e207bd0a1f6e..b0beddc2b3d7ff437d80310d353c13f610130bad 100644 (file)
@@ -190,8 +190,8 @@ public class Vala.Constant : Symbol {
                } else if (type is ArrayType) {
                        unowned ArrayType array_type = (ArrayType) type;
                        return check_const_type (array_type.element_type, context);
-               } else if (type.type_symbol.is_subtype_of (context.analyzer.string_type.type_symbol)) {
-                       return true;
+               } else if (type.type_symbol != null) {
+                       return type.type_symbol.is_subtype_of (context.analyzer.string_type.type_symbol);
                } else {
                        return false;
                }