FIX: Check for Webpacker config file existence before trying to access the configs

FIX: Check for Webpacker config file existence before trying to access the configs

Fixes: https://github.com/MiniProfiler/rack-mini-profiler/issues/457

diff --git a/lib/mini_profiler_rails/railtie_methods.rb b/lib/mini_profiler_rails/railtie_methods.rb
index 396692f..56889f7 100644
--- a/lib/mini_profiler_rails/railtie_methods.rb
+++ b/lib/mini_profiler_rails/railtie_methods.rb
@@ -52,7 +52,7 @@ module Rack::MiniProfilerRailsMethods
   end
 
   def get_webpacker_assets_path
-    if defined?(Webpacker)
+    if defined?(Webpacker) && Webpacker.config.config_path.exist?
       Webpacker.config.public_output_path.to_s.gsub(Webpacker.config.public_path.to_s, "")
     end
   end

GitHub sha: 7453c58c