From 0e1bf3c061a36edaea119d859aacb9764325c5bf Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 16 May 2021 16:02:00 +0200 Subject: 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. --- util/pubsub.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util') 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"; -- cgit v1.2.3