From a85f3773e3e395cf0eac7f241d4539d0cab0418c Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Fri, 12 Oct 2018 14:35:44 -0700 Subject: [PATCH] fix nil commentary case for pixiv strategy #3948 --- app/logical/sources/strategies/pixiv.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/logical/sources/strategies/pixiv.rb b/app/logical/sources/strategies/pixiv.rb index aec1f63f5..ed433541e 100644 --- a/app/logical/sources/strategies/pixiv.rb +++ b/app/logical/sources/strategies/pixiv.rb @@ -26,6 +26,10 @@ module Sources end def self.to_dtext(text) + if text.nil? + return nil + end + text = text.gsub(%r!https?://www\.pixiv\.net/member_illust\.php\?mode=medium&illust_id=([0-9]+)!i) do |match| pixiv_id = $1 %(pixiv ##{pixiv_id} "ยป":[/posts?tags=pixiv:#{pixiv_id}])