modelize_property: do not crash if mtype is null in check_visibility
authorJean Privat <jean@pryen.org>
Tue, 15 Jul 2014 19:15:44 +0000 (15:15 -0400)
committerJean Privat <jean@pryen.org>
Tue, 15 Jul 2014 19:15:44 +0000 (15:15 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/modelize_property.nit

index 5a0ece8..159523b 100644 (file)
@@ -205,7 +205,11 @@ redef class ModelBuilder
 
                # No error, try to go deeper in generic types
                if node isa AType then
-                       for a in node.n_types do check_visibility(a, a.mtype.as(not null), mpropdef)
+                       for a in node.n_types do
+                               var t = a.mtype
+                               if t == null then continue # Error, thus skipped
+                               check_visibility(a, t, mpropdef)
+                       end
                else if mtype isa MGenericType then
                        for t in mtype.arguments do check_visibility(node, t, mpropdef)
                end