Apparently results can be nil too
1 files changed, 1 insertions(+), 0 deletions(-) M app/controllers/fulfillment_controller.rb
M app/controllers/fulfillment_controller.rb => app/controllers/fulfillment_controller.rb +1 -0
@@ 12,6 12,7 @@ class FulfillmentController < ApplicationController def fetch_all_items(page: 1) results = WHIPLASH_HTTP.get("items", { page: page, limit: 1000 }, "X-API-KEY" => @shop.whiplash_api_key).body return [] unless results return results if results.empty? results + fetch_all_items(page: page + 1)