From bfed32398853af0917203c5a111a2f481c256e7e Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 10 Sep 2018 19:21:12 -0500 Subject: [PATCH] deviantart: fix page_url for when api data is unavailable. The api data is unavailable when we can't scrape the uuid, either because the work is deleted or because the work is actually a sta.sh upload and we weren't given the sta.sh page in the referer url. --- app/logical/sources/strategies/deviant_art.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index b0033dee3..041cc363f 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -87,8 +87,13 @@ module Sources end def page_url - return "" if api_deviation.blank? - api_deviation[:url] + if api_deviation.present? + api_deviation[:url] + elsif api_url.present? + api_url + else + "" + end end def profile_url