Fix type error

This commit is contained in:
Marek Calus
2020-10-22 11:30:44 +02:00
parent 15515ea60d
commit 0e8530b5fc
@@ -79,7 +79,7 @@ export class HigherOrderOperations implements HigherOrderOperation {
// Read the location fully, bailing on any errors
const readerOutput = await this.locationReader.read(spec);
if (!spec.pendingLocation && readerOutput.errors.length) {
if (!(spec.presence === 'optional') && readerOutput.errors.length) {
const item = readerOutput.errors[0];
throw new InputError(
`Failed to read location ${item.location.type}:${item.location.target}, ${item.error}`,