Changeset

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
parents 4717:3c0321e3fa76
children 4719:2087d42f1e77
files core/moduleapi.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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()