diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb index 9ca2c8f2f45..e64ce08380b 100644 --- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb +++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb @@ -41,7 +41,7 @@ JS end def self.reset_context - @ctx.dispose + @ctx&.dispose @ctx = nil end diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index fe9f1951923..2aa8d65a0f1 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -161,7 +161,7 @@ module JsLocaleHelper end def self.reset_context - @ctx.dispose + @ctx&.dispose @ctx = nil end diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index 40d000368fa..4c0d9550792 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -123,7 +123,7 @@ module PrettyText def self.reset_context @ctx_init.synchronize do - @ctx.dispose + @ctx&.dispose @ctx = nil end end