From a7fe47ddb539b6c7698ea85afba756f7a8f7e71e Mon Sep 17 00:00:00 2001 From: David Nichols Date: Sun, 2 Feb 2020 10:45:49 +0100 Subject: [PATCH] refs #3545 updated Mapper to accept the null input provider --- qlib/Mapper.qm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qlib/Mapper.qm b/qlib/Mapper.qm index 827e48203c..662de3911e 100644 --- a/qlib/Mapper.qm +++ b/qlib/Mapper.qm @@ -871,7 +871,7 @@ Mapper mapv(DataMap); "API", opts.input_provider.getName(), self.className()); } - if (!input) { + if (!exists input) { error("\"input_provider\" %y passed to %s::constructor() has an empty record type", input_provider.getName(), self.className()); } @@ -888,10 +888,10 @@ Mapper mapv(DataMap); private:internal *hash getFields(string pfx, AbstractDataProviderType type) { *hash fields = type.getFields(); - if (!fields) { + if (!fields && pfx != "input") { error("%s provider provides type %y which cannot be mapped", pfx, type.getName()); } - return fields; + return fields ?? {}; } private setOutputProvider(hash opts) {