diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb
index 12d10790ebce27d6ef29b84b668948ebbd7652bc..5b82097176753705952306ebc61da1ca6fdf8be7 100644
--- a/app/controllers/votes_controller.rb
+++ b/app/controllers/votes_controller.rb
@@ -13,7 +13,7 @@ class VotesController < ApplicationController
     recent_votes = Vote.where(created_at: 24.hours.ago..Time.now, user: current_user).count
     max_votes_per_day = SiteSetting['FreeVotes'] + (@current_user.reputation - SiteSetting['NewUserInitialRep'])
 
-    unless post&.parent&.user&.id == current_user.id
+    unless post.parent&.user_id == current_user.id
       if recent_votes >= max_votes_per_day
         vote_limit_msg = 'You have used your daily vote limit of ' + recent_votes.to_s + 'votes. Gain more reputation' \
                          ' or come back tomorrow to continue voting.'