Fixed bug where an empty corpus .json would cause archive command to fail

This commit is contained in:
Effy Elden 2016-02-22 23:12:25 +08:00
parent 36a64736bf
commit 55143feed4

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}"