typescript Object is possibly 'null' ?

I believe I set it all up correctly but tokens.data gives me an error
(property) data: (Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any)["Tables"]["tokens"]["Row"][] | null
Object is possibly 'null'.deno-ts(2531)

supabase.ts
export const getTokens = async () => {
  return await supabase.from('tokens').select('*')
}

// TYPES
type TokensResponse = Awaited<ReturnType<typeof getTokens>>
export type TokensResponseSuccess = TokensResponse['data']
export type TokensResponseError = TokensResponse['error']

main.ts
const tokens = await getTokens()
const ids = tokens.data.map(token => token.coingecko_id).filter(id => id != null)

What am I doing wrong?
Was this page helpful?