From 5a4e252a6ce14abba2da8bb7ac5c23b0a369d2cb Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 4 Aug 2018 15:44:38 +0200 Subject: mod_storage_internal: Only apply truncate if there are more items than requested --- plugins/mod_storage_internal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua index 27bd8830..42b451bd 100644 --- a/plugins/mod_storage_internal.lua +++ b/plugins/mod_storage_internal.lua @@ -191,7 +191,7 @@ function archive:delete(username, query) return item.when > query["end"]; end); end - if query.truncate then + if query.truncate and #items > query.truncate then if query.reverse then -- Before: { 1, 2, 3, 4, 5, } -- After: { 1, 2, 3 } -- cgit v1.2.3