Skip to content

Commit 9452411

Browse files
Added nil checks
1 parent 61e22cf commit 9452411

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/wayback_machine_downloader.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def get_all_snapshots_to_consider
241241
# Fetch the initial set of snapshots, sequentially
242242
@connection_pool.with_connection do |connection|
243243
initial_list = get_raw_list_from_api(@base_url, nil, connection)
244+
initial_list ||= []
244245
mutex.synchronize do
245246
snapshot_list_to_consider.concat(initial_list)
246247
print "."
@@ -265,6 +266,7 @@ def get_all_snapshots_to_consider
265266
@connection_pool.with_connection do |connection|
266267
result = get_raw_list_from_api("#{@base_url}/*", page, connection)
267268
end
269+
result ||= []
268270
[page, result]
269271
end
270272
end
@@ -284,7 +286,7 @@ def get_all_snapshots_to_consider
284286

285287
# Process results and check for empty pages
286288
results.each do |page, result|
287-
if result.empty?
289+
if result.nil? || result.empty?
288290
continue_fetching = false
289291
break
290292
else

0 commit comments

Comments
 (0)