add judge of nil value for ports and networkids
This commit is contained in:
parent
f4cff59064
commit
68a975d30a
|
@ -24,8 +24,8 @@ class BlockchainsService
|
|||
ports = []
|
||||
bcs = Blockchain.find_by_sql("select network_id, port from blockchains where user_id=#{user.id}")
|
||||
bcs.each do |bc|
|
||||
network_ids << bc.network_id
|
||||
ports << bc.port
|
||||
network_ids << bc.network_id unless network_id == nil
|
||||
ports << bc.port unless port == nil
|
||||
end
|
||||
Rails.logger.info(network_ids)
|
||||
Rails.logger.info(ports)
|
||||
|
|
Loading…
Reference in New Issue