various phases: more robust for keep-going
[nit.git] / src / frontend / div_by_zero.nit
index 4a8cfb4..6001f01 100644 (file)
@@ -37,7 +37,8 @@ private class DivByZeroPhase
        redef fun process_nmodule(nmodule)
        do
                # The AST node is not enough, we need also the associated model element
-               var mmodule = nmodule.mmodule.as(not null)
+               var mmodule = nmodule.mmodule
+               if mmodule == null then return
                # For the specific job we have, the simpler it to launch a visitor on
                # all elements of the AST.
                var visitor = new DivByZeroVisitor(toolcontext, mmodule)