Merge pull request #107 from ineffyble/master

Fixed bug where an empty corpus .json would cause archive command to fail
This commit is contained in:
Jaiden Mispy 2016-02-23 02:16:50 +11:00
commit 44d16f3b4f

View file

@ -49,7 +49,7 @@ module Ebooks
@client = client || make_client
if File.exists?(@path)
if (File.exists?(@path) && !File.zero?(@path))
@filetext = File.read(@path, :encoding => 'utf-8')
@tweets = JSON.parse(@filetext, symbolize_names: true)
log "Currently #{@tweets.length} tweets for #{@username}"