[vala/staging] vala: Handle unavailable type-symbol in Constant.check_const_type()



commit 4f48a27ac93913667413d42f34a04b25949ee4a9
Author: Princeton Ferro <princetonferro gmail com>
Date:   Thu Feb 20 15:31:13 2020 +0100

    vala: Handle unavailable type-symbol in Constant.check_const_type()
    
    This caused criticals like:
    
      vala_typesymbol_is_subtype_of: assertion 'self != NULL' failed

 vala/valaconstant.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala
index 809cb883d..b0beddc2b 100644
--- a/vala/valaconstant.vala
+++ b/vala/valaconstant.vala
@@ -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;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]