Permalink
Browse files

FIX: Empty array on transaction serializer

  • Loading branch information...
joebuhlig committed May 27, 2017
1 parent 9bc1514 commit 42faeb5d7562bd4066420499f8ccbf44ba90c44b
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/serializers/discourse_league/transaction_serializer.rb
@@ -12,8 +12,10 @@ class TransactionSerializer < ApplicationSerializer

def product_name
products = PluginStore.get("discourse_league", "levels") || []
product = products.select{|level| level[:id] == object.product_id.to_i} if !products.empty?
product[0][:name]
product = products.select{|level| level[:id] == object.product_id.to_i}
if !product.empty?
product[0][:name]
end
end

end

0 comments on commit 42faeb5

Please sign in to comment.