util.pubsub: Fix traceback if node data not initialized
This should not be possible, but a traceback indicating node_data being
nil here was reported by Ron in the chat.
--- a/util/pubsub.lua Wed May 12 16:42:51 2021 +0100
+++ b/util/pubsub.lua Sun May 16 16:02:00 2021 +0200
@@ -555,6 +555,10 @@
return nil, "invalid-item";
end
local node_data = self.data[node];
+ if not node_data then
+ -- FIXME how is this possible? #1657
+ return nil, "internal-server-error";
+ end
local ok = node_data:set(id, item);
if not ok then
return nil, "internal-server-error";