diff app/models/tweet.rb @ 177:3176bd0d3c2c

Correct casing check
author nanaya <me@nanaya.pro>
date Sat, 13 Oct 2018 00:48:05 +0900
parents 08cc4a4d8a5f
children 17461f7682a2
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