Skip to content

Commit

Permalink
refs #3545 updated Mapper to accept the null input provider
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnich committed Feb 2, 2020
1 parent 5b07d9d commit a7fe47d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qlib/Mapper.qm
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -888,10 +888,10 @@ Mapper mapv(DataMap);

private:internal *hash<string, AbstractDataField> getFields(string pfx, AbstractDataProviderType type) {
*hash<string, AbstractDataField> 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<auto> opts) {
Expand Down

0 comments on commit a7fe47d

Please sign in to comment.