mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Added nil checks
This commit is contained in:
parent
61e22cfe25
commit
9452411e32
@ -241,6 +241,7 @@ class WaybackMachineDownloader
|
|||||||
# Fetch the initial set of snapshots, sequentially
|
# Fetch the initial set of snapshots, sequentially
|
||||||
@connection_pool.with_connection do |connection|
|
@connection_pool.with_connection do |connection|
|
||||||
initial_list = get_raw_list_from_api(@base_url, nil, connection)
|
initial_list = get_raw_list_from_api(@base_url, nil, connection)
|
||||||
|
initial_list ||= []
|
||||||
mutex.synchronize do
|
mutex.synchronize do
|
||||||
snapshot_list_to_consider.concat(initial_list)
|
snapshot_list_to_consider.concat(initial_list)
|
||||||
print "."
|
print "."
|
||||||
@ -265,6 +266,7 @@ class WaybackMachineDownloader
|
|||||||
@connection_pool.with_connection do |connection|
|
@connection_pool.with_connection do |connection|
|
||||||
result = get_raw_list_from_api("#{@base_url}/*", page, connection)
|
result = get_raw_list_from_api("#{@base_url}/*", page, connection)
|
||||||
end
|
end
|
||||||
|
result ||= []
|
||||||
[page, result]
|
[page, result]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -284,7 +286,7 @@ class WaybackMachineDownloader
|
|||||||
|
|
||||||
# Process results and check for empty pages
|
# Process results and check for empty pages
|
||||||
results.each do |page, result|
|
results.each do |page, result|
|
||||||
if result.empty?
|
if result.nil? || result.empty?
|
||||||
continue_fetching = false
|
continue_fetching = false
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user