moduleapi: get_host_type(): Return nil for global modules (no host)
authorMatthew Wild <mwild1@gmail.com>
Fri, 27 Apr 2012 18:34:40 +0100
changeset 4718 a9f6088a83e3
parent 4717 3c0321e3fa76
child 4719 2087d42f1e77
moduleapi: get_host_type(): Return nil for global modules (no host)
core/moduleapi.lua
--- a/core/moduleapi.lua	Thu Apr 26 16:53:32 2012 +0100
+++ b/core/moduleapi.lua	Fri Apr 27 18:34:40 2012 +0100
@@ -42,7 +42,7 @@
 end
 
 function api:get_host_type()
-	return hosts[self.host].type;
+	return self.host ~= "*" and hosts[self.host].type or nil;
 end
 
 function api:set_global()