aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-05-16 16:02:00 +0200
committerKim Alvefur <zash@zash.se>2021-05-16 16:02:00 +0200
commit0e1bf3c061a36edaea119d859aacb9764325c5bf (patch)
tree143acd41bb2646911b1d45a78d3bc0f90d74ca8f
parenta95576d485eda2a273b4d66c4c2b363f88c5c43a (diff)
downloadprosody-0e1bf3c061a36edaea119d859aacb9764325c5bf.tar.gz
prosody-0e1bf3c061a36edaea119d859aacb9764325c5bf.zip
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.
-rw-r--r--util/pubsub.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 1674b9a7..7ccc817f 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -555,6 +555,10 @@ function service:publish(node, actor, id, item, requested_config) --> ok, err
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";