Make JSON more robust
In cases where a finding was empty (error condition), the JSON output wasn't valid because the finding wasn't printed to file. This commit makes sure that always a finding is printed, also if it is empty. FIX #1112
This commit is contained in:
parent
1bfc9ca5b8
commit
a24a502716
|
@ -753,7 +753,7 @@ fileout_json_print_parameter() {
|
|||
"$do_json" && \
|
||||
spaces=" " || \
|
||||
spaces=" "
|
||||
if [[ ! -z "$value" ]]; then
|
||||
if [[ -n "$value" ]] || [[ "$parameter" == finding ]]; then
|
||||
printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
|
||||
"$not_last" && printf ",\n" >> "$JSONFILE"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue