From 43fd83464d8f58cf32a4384685cd86938fde4ac9 Mon Sep 17 00:00:00 2001 From: Pontus Walck Date: Thu, 12 Mar 2015 12:24:49 +0100 Subject: [PATCH] Prevent crash on empty list of followers Users with no followers caused a crash in "print_users". --- lib/t/printable.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/t/printable.rb b/lib/t/printable.rb index 6e53273d..2e80a541 100644 --- a/lib/t/printable.rb +++ b/lib/t/printable.rb @@ -183,6 +183,7 @@ def print_tweets(tweets) end def print_users(users) # rubocop:disable CyclomaticComplexity + return if users.nil? users = case options['sort'] when 'favorites' users.sort_by { |user| user.favorites_count.to_i }