changeset 14173:44e5c73e6fa3 13.0

util.dataforms: Don't treat invalid jid-multi as missing If all the submitted JIDs were invalid, #results would be 0 and the field would be treated as absent rather than invalid.
author Matthew Wild <mwild1@gmail.com>
date Mon, 25 May 2026 13:14:53 +0100
parents 94172bbf9074
children 604bed81808e
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/dataforms.lua	Mon May 25 11:32:33 2026 +0100
+++ b/util/dataforms.lua	Mon May 25 13:14:53 2026 +0100
@@ -252,7 +252,7 @@
 				err[#err+1] = ("Invalid JID: " .. raw_value);
 			end
 		end
-		if #result > 0 then
+		if #result > 0 or #err > 0 then
 			return result, (#err > 0 and t_concat(err, "\n") or nil);
 		elseif required then
 			return nil, "Required value missing";