fix null zone ID bug

TNT has started serving half-removed Corridor of Chance effects:
it has the asset ID and URL and all, but the zone ID is blank.
RocketAMF has patched the empty key bug, and now we ignore assets
associated with empty keys.
This commit is contained in:
Emi Matchu 2013-05-23 18:48:19 -07:00
parent 2fc0e61394
commit 2501cb5667
2 changed files with 3 additions and 3 deletions

View file

@ -68,7 +68,7 @@ GIT
GIT GIT
remote: git://github.com/rubyamf/rocketamf.git remote: git://github.com/rubyamf/rocketamf.git
revision: 3f16cf841d9c36045f720b307bbffa61fb63a7ac revision: 796f591d002b5cf47df436dbcbd6f2ab00e869ed
specs: specs:
RocketAMF (1.0.0) RocketAMF (1.0.0)

View file

@ -138,7 +138,7 @@ class PetState < ActiveRecord::Base
def self.from_pet_type_and_biology_info(pet_type, info) def self.from_pet_type_and_biology_info(pet_type, info)
swf_asset_ids = [] swf_asset_ids = []
info.each do |zone_id, asset_info| info.each do |zone_id, asset_info|
if asset_info if zone_id.present? && asset_info
swf_asset_ids << asset_info[:part_id].to_i swf_asset_ids << asset_info[:part_id].to_i
end end
end end
@ -166,7 +166,7 @@ class PetState < ActiveRecord::Base
pet_state.pet_type = pet_type # save the second case from having to look it up by ID pet_state.pet_type = pet_type # save the second case from having to look it up by ID
relationships = [] relationships = []
info.each do |zone_id, asset_info| info.each do |zone_id, asset_info|
if asset_info if zone_id.present? && asset_info
swf_asset_id = asset_info[:part_id].to_i swf_asset_id = asset_info[:part_id].to_i
swf_asset = existing_swf_assets_by_id[swf_asset_id] swf_asset = existing_swf_assets_by_id[swf_asset_id]
unless swf_asset unless swf_asset