Skip to content
This repository was archived by the owner on Mar 31, 2022. It is now read-only.

Commit 2e860fd

Browse files
committed
Handle nil video URLs
1 parent 5245edf commit 2e860fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/models/lentil/image.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ def jpeg
142142
end
143143

144144
def https_ig_url(my_url = url)
145-
# instagr.am returns 301 to instagram.com and invalid SSL certificate
146-
my_url.sub(/^http:/, 'https:').sub(/\/\/instagr\.am/, '//instagram.com')
145+
if my_url.respond_to?('sub')
146+
# instagr.am returns 301 to instagram.com and invalid SSL certificate
147+
my_url.sub(/^http:/, 'https:').sub(/\/\/instagr\.am/, '//instagram.com')
148+
else
149+
my_url
150+
end
147151
end
148152

149153
def large_url(https_ig = true)

0 commit comments

Comments
 (0)