Created
January 28, 2016 17:12
-
-
Save anarchivist/e1563583627602965ea7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/models/item.rb b/app/models/item.rb | |
| index e405e27..3cc5222 100644 | |
| --- a/app/models/item.rb | |
| +++ b/app/models/item.rb | |
| @@ -126,7 +126,14 @@ class Item | |
| end | |
| def preview_image | |
| - @object | |
| + uri = URI.parse(@object) | |
| + if uri.kind_of?(URI::HTTP) | |
| + @object | |
| + else | |
| + nil | |
| + end | |
| + rescue URI::InvalidURIError | |
| + nil | |
| end | |
| def data_provider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment