From 2501cb5667b1f81f0f68190dc9a9738a5d1fd5e6 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 23 May 2013 18:48:19 -0700 Subject: [PATCH] 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. --- Gemfile.lock | 2 +- app/models/pet_state.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f15f1890..a24e2b7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,7 +68,7 @@ GIT GIT remote: git://github.com/rubyamf/rocketamf.git - revision: 3f16cf841d9c36045f720b307bbffa61fb63a7ac + revision: 796f591d002b5cf47df436dbcbd6f2ab00e869ed specs: RocketAMF (1.0.0) diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index 859d7b19..0b3678b6 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -138,7 +138,7 @@ class PetState < ActiveRecord::Base def self.from_pet_type_and_biology_info(pet_type, info) swf_asset_ids = [] 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 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 relationships = [] 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 = existing_swf_assets_by_id[swf_asset_id] unless swf_asset