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



commit eda758f35050e3c308991a6cb0573d3dbdea8f0c
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 2b0466c19..c897cd892 100644
--- a/vala/valaconstant.vala
+++ b/vala/valaconstant.vala
@@ -190,8 +190,8 @@ public class Vala.Constant : Symbol {
                } else if (type is ArrayType) {
                        var array_type = type as ArrayType;
                        return check_const_type (array_type.element_type, context);
-               } else if (type.data_type.is_subtype_of (context.analyzer.string_type.data_type)) {
-                       return true;
+               } else if (type.data_type != null) {
+                       return type.data_type.is_subtype_of (context.analyzer.string_type.data_type);
                } else {
                        return false;
                }


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