Diff

core/moduleapi.lua @ 4718:a9f6088a83e3

moduleapi: get_host_type(): Return nil for global modules (no host)
author Matthew Wild <mwild1@gmail.com>
date Fri, 27 Apr 2012 18:34:40 +0100
parent 4708:0e324923ff95
child 4719:2087d42f1e77
line wrap: on
line diff
--- 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()