Skip to content
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

Merged
merged 4 commits into from
May 7, 2015
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/tumblr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def self.post_to_hash(post, format)
when "video"
title = post["video-title"]
content = post["video-player"]
Copy link
Member

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.

unless post["video-caption"].nil?
unless content.nil? || post["video-caption"].nil?
content << "<br/>" + post["video-caption"]
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if content is nil, should we say content = post["video-caption"]?

when "answer"
Expand Down