diff --git a/app/queries/blockchain/balance_query.rb b/app/queries/blockchain/balance_query.rb index 1c00152ed..ec765b997 100644 --- a/app/queries/blockchain/balance_query.rb +++ b/app/queries/blockchain/balance_query.rb @@ -12,8 +12,8 @@ class Blockchain::BalanceQuery < ApplicationQuery token_list = find_repo_with_token(params["user_id"]) result_list = [] token_list.each do |t| - owner = User.find_by(id: t['username'].to_i) project = Project.find_by(id: t['token_name'].to_i) + owner = User.find_by(id: project.user_id) if owner.nil? || project.nil? else balance = t['balance']