lacostej/iOSprovisioningprofiles — Issue #2: Dev center script fails with no profiles
Author: steveworkman
Created: 2012-03-01 16:22:30+00:00
State: open

Hi,

1. Thank you so much for this script, it's a lifesaver.

2. If I've got a license that I use exclusively for distribution, not development, I get an error when running the job.
Stack trace:
+ ruby ./apple_dev_center.rb -C CONFIGLOCATION.config -u USERNAME -d -O adc/site.json
./apple_dev_center.rb:139:in `read_profiles': undefined method `text' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:239:in `each'
from /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:238:in `upto'
from /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:238:in `each'
from ./apple_dev_center.rb:135:in `read_profiles'
from ./apple_dev_center.rb:153:in `read_all_profiles'
from ./apple_dev_center.rb:150:in `each'
from ./apple_dev_center.rb:150:in `read_all_profiles'
from ./apple_dev_center.rb:176:in `fetch_site_data'
from ./apple_dev_center.rb:208:in `dumpSite'
from ./apple_dev_center.rb:223:in `main'
from ./apple_dev_center.rb:228
Fetching devices
Fetching development profiles
Fetching distribution profiles
Build step 'Execute shell' marked build as failure

Tracing it back it looks like it's just failing on an empty row. Can an extra check be added?