From b47787fcd9e811175f939a26e4e547c2d9865015 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Mon, 25 Mar 2019 15:55:47 +0100 Subject: [plugins] add_string_as_file to deal with empty content properly If add_string_as_file is called with emtpy content, dont attempt to parse it but set summary to '' directly. Resolves: #1620 Signed-off-by: Pavel Moravec --- sos/plugins/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index a2c9ba6c..607828f9 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -959,7 +959,7 @@ class Plugin(object): """Add a string to the archive as a file named `filename`""" # Generate summary string for logging - summary = content.splitlines()[0] + summary = content.splitlines()[0] if content else '' if not isinstance(summary, six.string_types): summary = content.decode('utf8', 'ignore') -- cgit