From 8a16e089d2ca46e28c3a8deb80d891ffafe459f7 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Tue, 16 Apr 2019 14:00:38 -0700 Subject: [PATCH] don't try to parse deviant art urls that lack a deviation id in the url --- app/logical/sources/strategies/deviant_art.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 85e0c0607..95846c366 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -91,7 +91,7 @@ module Sources # work isn't downloadable, or download size is same as regular size. elsif api_deviation.present? src = api_deviation.dig(:content, :src) - if deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/ + if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/ src = src.sub(%r!(/f/[a-f0-9-]+/[a-f0-9-]+)!, '/intermediary\1') src = src.sub(%r!/v1/(fit|fill)/.*\z!i, "") end