Permalink
Browse files

Fix rake task crash when not using default app (so there is no pem file)

  • Loading branch information...
1 parent c69bf3b commit 51c47140d87dcdbaaa5847a31bae2b9c2bc1fd34 @rdj rdj committed with chrisrhoden Nov 24, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/apn_on_rails/app/models/apn/app.rb
@@ -31,8 +31,8 @@ def self.send_notifications
apps.each do |app|
app.send_notifications
end
- global_cert = File.read(configatron.apn.cert)
- if global_cert
+ if !configatron.apn.cert.blank?
+ global_cert = File.read(configatron.apn.cert)
send_notifications_for_cert(global_cert, nil)
end
end
@@ -123,8 +123,8 @@ def self.process_devices
apps.each do |app|
app.process_devices
end
- global_cert = File.read(configatron.apn.cert)
- if global_cert
+ if !configatron.apn.cert.blank?
+ global_cert = File.read(configatron.apn.cert)
APN::App.process_devices_for_cert(global_cert)
end
end

0 comments on commit 51c4714

Please sign in to comment.