Browse files

Silently fail on notify_about when subscription orphaned

  • Loading branch information...
1 parent dd6e1fd commit cc2a9ae37a16ad9f7e16084c82ece84ee1e327f0 Jesse Stuart committed Dec 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tentd/model/notification_subscription.rb
View
2 lib/tentd/model/notification_subscription.rb
@@ -111,7 +111,7 @@ def self.notify_entity(entity, post_id, view='full')
def notify_about(post_id, view='full')
post = Post.first(:id => post_id)
- return unless post
+ return unless post && subject
client = TentClient.new(subject.notification_servers, subject.auth_details.merge(:faraday_adapter => TentD.faraday_adapter))
permissions = subject.respond_to?(:scopes) && subject.scopes.to_a.include?(:read_permissions)
res = client.post.create(post.as_json(:app => !!app_authorization, :permissions => permissions, :view => view), :url => subject.notification_path)

0 comments on commit cc2a9ae

Please sign in to comment.