From 7f79b790c73ca68c7f35a7573f40a6685a7fa913 Mon Sep 17 00:00:00 2001 From: Yuta Iwama Date: Tue, 10 Dec 2019 17:59:07 +0900 Subject: [PATCH] block nil Signed-off-by: Yuta Iwama --- lib/fluent/plugin/buf_file.rb | 4 +++- lib/fluent/plugin/buf_file_single.rb | 4 +++- lib/fluent/plugin/in_tail.rb | 4 +++- lib/fluent/plugin_id.rb | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index beab1913c5..61bb5150ea 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -127,7 +127,9 @@ def start end def stop - @variable_store.delete(@buffer_path) + if @variable_store + @variable_store.delete(@buffer_path) + end super end diff --git a/lib/fluent/plugin/buf_file_single.rb b/lib/fluent/plugin/buf_file_single.rb index fdbcb12175..e15d74a90a 100644 --- a/lib/fluent/plugin/buf_file_single.rb +++ b/lib/fluent/plugin/buf_file_single.rb @@ -147,7 +147,9 @@ def start end def stop - @variable_store.delete(@path) + if @variable_store + @variable_store.delete(@path) + end super end diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 7a9de0fe4c..f8bb655700 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -205,7 +205,9 @@ def start end def stop - @variable_store.delete(@pos_file) + if @variable_store + @variable_store.delete(@pos_file) + end super end diff --git a/lib/fluent/plugin_id.rb b/lib/fluent/plugin_id.rb index cbe4707b98..1a4fe4065d 100644 --- a/lib/fluent/plugin_id.rb +++ b/lib/fluent/plugin_id.rb @@ -82,7 +82,9 @@ def plugin_root_dir end def stop - @_plugin_id_variable_store.delete(@id) + if @_plugin_id_variable_store + @_plugin_id_variable_store.delete(@id) + end super end