Fix: fix error handling in Portainer Kubernetes widget (#5584)

This commit is contained in:
shamoon
2025-07-27 20:07:37 -07:00
committed by GitHub
parent 8c4e73e122
commit fa2efb1ac9

View File

@@ -34,10 +34,10 @@ export default function Component({ service }) {
);
if (widget.kubernetes) {
const error = applicationsError ?? servicesError ?? namespacesError;
// count can be an error object
const error = applicationsError ?? servicesError ?? namespacesError ?? applicationsCount;
if (error) {
return <Container service={service} error={error} />;
if (error || typeof applicationsCount === "object") {
return <Container service={service} error={error ?? applicationsCount} />;
}
if (applicationsCount == undefined || servicesCount == undefined || namespacesCount == undefined) {