Comparison

util/pubsub.lua @ 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
parent 10519:641e3b7a6a39
child 11567:c471e19a238e
comparison
equal deleted inserted replaced
11559:56785f32e1d4 11565:087b275a9aee
553 end 553 end
554 if not self.config.itemcheck(item) then 554 if not self.config.itemcheck(item) then
555 return nil, "invalid-item"; 555 return nil, "invalid-item";
556 end 556 end
557 local node_data = self.data[node]; 557 local node_data = self.data[node];
558 if not node_data then
559 -- FIXME how is this possible? #1657
560 return nil, "internal-server-error";
561 end
558 local ok = node_data:set(id, item); 562 local ok = node_data:set(id, item);
559 if not ok then 563 if not ok then
560 return nil, "internal-server-error"; 564 return nil, "internal-server-error";
561 end 565 end
562 if type(ok) == "string" then id = ok; end 566 if type(ok) == "string" then id = ok; end