-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Tumblr) Add nil check to prevent undefined method error (fixes #29) #179
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,8 +131,10 @@ def self.post_to_hash(post, format) | |
when "video" | ||
title = post["video-title"] | ||
content = post["video-player"] | ||
unless post["video-caption"].nil? | ||
content << "<br/>" + post["video-caption"] | ||
unless post[:content].nil? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this check unless content.nil? || post["video-caption"].nil?
content << "<br/>" + post["video-caption"]
end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, would you like me to make this change to the PR? Unfortunately, I would have no way to try it out though... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes please! :) |
||
unless post["video-caption"].nil? | ||
content << "<br/>" + post["video-caption"] | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
when "answer" | ||
title = post["question"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
content
is false, then it means something went wrong here.