Skip to content

Commit 9ae33cf

Browse files
committed
Fix typecheck: guard against empty codec targetTypes in SQL provider
When skipping unresolvable codecs was introduced, the narrowing from a non-null codec lookup no longer guaranteed targetTypes[0] was defined under noUncheckedIndexedAccess. Skip descriptors whose codec has no target types instead of assigning undefined to nativeType.
1 parent 5094a3d commit 9ae33cf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/2-sql/2-authoring/contract-psl/src/provider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ function buildColumnDescriptorMap(
2323
for (const [typeName, codecId] of scalarTypeDescriptors) {
2424
const codec = codecLookup.get(codecId);
2525
if (!codec) continue;
26-
result.set(typeName, { codecId, nativeType: codec.targetTypes[0] });
26+
const nativeType = codec.targetTypes[0];
27+
if (nativeType === undefined) continue;
28+
result.set(typeName, { codecId, nativeType });
2729
}
2830
return result;
2931
}

0 commit comments

Comments
 (0)