nitx: do not crash if nmodule.n_moduledecl is null
authorJean Privat <jean@pryen.org>
Fri, 30 Aug 2013 19:45:47 +0000 (15:45 -0400)
committerJean Privat <jean@pryen.org>
Fri, 30 Aug 2013 19:45:47 +0000 (15:45 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/nitx.nit

index dcf71d2..7af5fc4 100644 (file)
@@ -157,7 +157,7 @@ class NitIndex
                        # comment
                        if mbuilder.mmodule2nmodule.has_key(mmodule) then
                                var nmodule = mbuilder.mmodule2nmodule[mmodule]
-                               if not nmodule.n_moduledecl.n_doc == null then
+                               if nmodule.n_moduledecl != null and nmodule.n_moduledecl.n_doc != null then
                                        for comment in nmodule.n_moduledecl.n_doc.comment do pager.add(comment.green)
                                end
                        end