Skip to content

Commit 3d904cd

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oci-compute): narrow selector output without a double cast
1 parent ff94dac commit 3d904cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/lib/selectors/server/providers/oci-compute.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ async function executeCompute(args: ExecuteServerSelectorArgs, prepared: Prepare
214214
if (direct && result.output.status === 404) return detailSelectorResult(null)
215215
throw selectorProviderStatusError(result.output.status || 502)
216216
}
217-
const output = result.output as unknown as Record<string, unknown>
217+
const output = result.output
218+
if (!isPlainRecord(output)) throw new SelectorOptionsUnavailableError()
218219
if (direct) {
219220
const resource = output[selector.singular]
220221
if (!isPlainRecord(resource)) throw new SelectorOptionsUnavailableError()

0 commit comments

Comments
 (0)