util.pubsub: Don't record publisher when superuser privileges are used (eg by modules)
authorKim Alvefur <zash@zash.se>
Sat, 29 Jul 2017 13:09:57 +0200
changeset 8223 a1b0fa38fca7
parent 8222 2e68ae095645
child 8224 4989a625419a
util.pubsub: Don't record publisher when superuser privileges are used (eg by modules)
util/pubsub.lua
--- a/util/pubsub.lua	Wed Apr 26 12:11:11 2017 +0200
+++ b/util/pubsub.lua	Sat Jul 29 13:09:57 2017 +0200
@@ -268,7 +268,9 @@
 		node_obj = self.nodes[node];
 	end
 	local node_data = self.data[node];
-	item.attr.publisher = actor;
+	if type(actor) == "string" then
+		item.attr.publisher = actor;
+	end
 	local ok = node_data:set(id, item);
 	if not ok then
 		return nil, "internal-server-error";