Allow destroying a bus that never had a backend

Allow destroying a bus that never had a backend

From e7e4e2fb5a33a68345634dbbbfcd8964d897677f Mon Sep 17 00:00:00 2001
From: Ben Langfeld <blangfeld@powerhrg.com>
Date: Wed, 28 Nov 2018 16:10:42 -0200
Subject: [PATCH] Allow destroying a bus that never had a backend


diff --git a/lib/message_bus.rb b/lib/message_bus.rb
index dcb3666..ea6a31b 100644
--- a/lib/message_bus.rb
+++ b/lib/message_bus.rb
@@ -524,7 +524,7 @@ module MessageBus::Implementation
 
   # (see MessageBus::Backend::Base#reset!)
   def reset!
-    reliable_pub_sub.reset!
+    reliable_pub_sub.reset! if reliable_pub_sub
   end
 
   # @return [MessageBus::TimerThread] the timer thread used for triggering

GitHub