diff --git a/app/models/communication/website/with_screenshot.rb b/app/models/communication/website/with_screenshot.rb index 014b85c0f31d2f2e606b71f267b9f17335e8a2f5..46869832fda39fc18f675786d32d46d20129bc0f 100644 --- a/app/models/communication/website/with_screenshot.rb +++ b/app/models/communication/website/with_screenshot.rb @@ -6,8 +6,10 @@ module Communication::Website::WithScreenshot end def screenshot! + return if url.blank? screenshot_url = Screenshot.capture(url) downloaded_image = URI.open(screenshot_url) - self.screenshot.attach(io: downloaded_image , filename: "screenshot.png") + self.screenshot.attach io: downloaded_image, + filename: "screenshot.png" end end \ No newline at end of file