# HG changeset patch # User Kim Alvefur # Date 1507592507 -7200 # Node ID 8648cb171213172697e9673ee40c710e79ed833e # Parent 967f04fe7fd4314e40c2bec3529529d2a5692212 util.pubsub: Return item-not-found if a single item is requested, and not there diff -r 967f04fe7fd4 -r 8648cb171213 util/pubsub.lua --- a/util/pubsub.lua Mon Oct 09 13:45:53 2017 +0200 +++ b/util/pubsub.lua Tue Oct 10 01:41:47 2017 +0200 @@ -338,7 +338,11 @@ return false, "item-not-found"; end if id then -- Restrict results to a single specific item - return true, { id, [id] = self.data[node]:get(id) }; + local with_id = self.data[node]:get(id); + if not with_id then + return false, "item-not-found"; + end + return true, { id, [id] = with_id }; else local data = {} for key, value in self.data[node]:items() do