cirandas.net

commit 4b9eb38449fd7c1b4387d951b4026e6571595fb1

Author: Hugo Melo <hugo@riseup.net>

Fix remove_consumer

 plugins/suppliers/lib/ext/profile.rb | 2 +-


diff --git a/plugins/suppliers/lib/ext/profile.rb b/plugins/suppliers/lib/ext/profile.rb
index e87ff322c6a2348de55148b4721f48ea07e24b0d..15a981b2f696c550aac1e277a3a65a8beb3d4440 100644
--- a/plugins/suppliers/lib/ext/profile.rb
+++ b/plugins/suppliers/lib/ext/profile.rb
@@ -53,7 +53,7 @@     consumer ||= self.consumers.create! profile: self, consumer: consumer_profile
   end
   def remove_consumer consumer_profile
     consumer = self.consumers.of_consumer(consumer_profile).first
-    consumer.destroy if supplier
+    consumer.destroy if consumer
   end
 
   def add_supplier supplier_profile, attrs={}