changeset 177:3176bd0d3c2c

Correct casing check
author nanaya <me@nanaya.pro>
date Sat, 13 Oct 2018 00:48:05 +0900
parents 08cc4a4d8a5f
children 38598ae5a8f6
files app/models/tweet.rb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/tweet.rb	Thu Oct 04 22:21:57 2018 +0900
+++ b/app/models/tweet.rb	Sat Oct 13 00:48:05 2018 +0900
@@ -63,7 +63,7 @@
           if data[:result] == :ok
             user = data[:data]
 
-            if user.id != @twitter_id && user.screen_name.downcase != @twitter_id
+            if user.id != @twitter_id && user.screen_name.downcase != @twitter_id.try(:downcase)
               throw "Wrong user data. Requested: #{@twitter_id}, got: #{user.id} (#{user.screen_name.printable})"
             end
           end