From 2282b01839e2b2bf1c92bef7424d6582ecb994c9 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 18 Aug 2018 14:21:02 +0100 Subject: util.pubsub: get_last_item(): Fail with item-not-found if no item yet published --- util/pubsub.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/pubsub.lua b/util/pubsub.lua index 72f7f5a7..ca6dca20 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -598,8 +598,8 @@ function service:get_last_item(node, actor) end -- - -- Check node exists - if not self.nodes[node] then + -- Check node exists and has an item published + if not (self.nodes[node] and self.data[node]) then return false, "item-not-found"; end -- cgit v1.2.3