path_tokens null on storage object insert trigger

BEGIN
  IF new.bucket_id != 'team-gallery' THEN
    RETURN null;
  END IF;
  INSERT INTO public.gallery
  (object_id, user_id, team_id)
  VALUES
  (new.id, new.owner, new.path_tokens[0]::uuid);

  RETURN new;
END;

While inserting the team_id into the gallery table from the new.path_tokens[0] team_id is null. The object that I am listening for an insert from is in a folder with the uuid of the team.
Was this page helpful?