Ruby 4.1 リファレンスマニュアル

instance method NilClass#to_a

to_a -> Array[permalink][rdoc][edit]

空配列 [] を返します。

p nil.to_a #=> []