Skip to content

Commit

Permalink
fix(whmcs-status): handle null correctly in whmcs api response
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-benedetti committed Jan 31, 2025
1 parent 713f4df commit d1afdf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion check-plugins/whmcs-status/unit-test/stdout/EXAMPLE02
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
"severityLevel": "info",
"body": "<p>Your PHP version <strong>8.1.31</strong> is supported by WHMCS. </p><p>Your PHP version does not receive regular updates but is the latest supported by WHMCS.</p>"
}
]
],
"warning": null,
"danger": null
}
}
4 changes: 3 additions & 1 deletion check-plugins/whmcs-status/unit-test/stdout/EXAMPLE03
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
"severityLevel": "notice",
"body": "WHMCS is not running behind a CloudFlare proxy."
}
]
],
"warning": null,
"danger": null
}
}
2 changes: 2 additions & 0 deletions check-plugins/whmcs-status/whmcs-status
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def get_failed_checks(checks):
"""
failed_checks = []
for _, items in checks.get('checks', {}).items():
if items is None:
continue
for item in items:
if item.get('severityLevel') == 'notice':
continue
Expand Down

0 comments on commit d1afdf6

Please sign in to comment.