Changeset

11565:087b275a9aee 0.11

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.
author Kim Alvefur <zash@zash.se>
date Sun, 16 May 2021 16:02:00 +0200
parents 11559:56785f32e1d4
children 11566:6e67872bcba4
files util/pubsub.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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";