loader: do not crash in `search_mmodule_by_name` if anode is null
authorJean Privat <jean@pryen.org>
Tue, 20 Oct 2015 20:37:22 +0000 (16:37 -0400)
committerJean Privat <jean@pryen.org>
Tue, 20 Oct 2015 20:37:22 +0000 (16:37 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/loader.nit

index aa88cdc..09201b0 100644 (file)
@@ -238,7 +238,9 @@ redef class ModelBuilder
                        end
                end
 
-               var candidate = search_module_in_paths(anode.hot_location, name, lookpaths)
+               var loc = null
+               if anode != null then loc = anode.hot_location
+               var candidate = search_module_in_paths(loc, name, lookpaths)
 
                if candidate == null then
                        if mgroup != null then