FIX: Check backtrace and backtrace_locations before trying to print an error

FIX: Check backtrace and backtrace_locations before trying to print an error

… during plugin initialization.

diff --git a/lib/plugin_initialization_guard.rb b/lib/plugin_initialization_guard.rb
index 11fd943..42c1bda 100644
--- a/lib/plugin_initialization_guard.rb
+++ b/lib/plugin_initialization_guard.rb
@@ -6,7 +6,7 @@ def plugin_initialization_guard(&block)
   rescue => error
     plugins_directory = Rails.root + 'plugins'
 
-    if error.backtrace
+    if error.backtrace && error.backtrace_locations
       plugin_path = error.backtrace_locations.lazy.map do |location|
         Pathname.new(location.absolute_path)
           .ascend

GitHub sha: 38c05a4f