Fix a bug where the summary for Defender alerts are entirely State.OK; the "details" field doesn't like an empty string.

This commit is contained in:
Marsell Kukuljevic 2024-12-06 15:59:21 +01:00
parent 6d39ee351b
commit 1b4fafb15e
3 changed files with 3 additions and 0 deletions

Binary file not shown.

View File

@ -252,6 +252,9 @@ def check_defender(item, params, section):
if state.value > State.OK.value:
region_details.append(f"{severity}: {info}: {url}")
if region_details == []:
region_details = ["No Defender alerts"]
yield Result(
state=final_state,
summary=f"High: {num_high}, Medium: {num_med}, Low: {num_low}, Informational: {num_info}",