Skip to content

Commit

Permalink
don't choke on empty config file
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed May 28, 2012
1 parent 18628f8 commit 3249dc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/hub/github_api.rb
Expand Up @@ -285,7 +285,8 @@ def entry_for_user host, username
end

def load
@data.update YAML.load(File.read(@filename))
existing_data = File.read(@filename)
@data.update YAML.load existing_data unless existing_data.strip.empty?
end

def save
Expand Down

0 comments on commit 3249dc6

Please sign in to comment.