mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 11:13:26 +00:00
Add null-safety for dockerHosts in DockerRoute
Prevent 'Cannot read properties of undefined (reading length)' by ensuring dockerHosts defaults to empty array if undefined.
This commit is contained in:
@@ -71,7 +71,8 @@ function DockerRoute() {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
const { state, activeAlerts } = wsContext;
|
||||
return <DockerHosts hosts={state().dockerHosts} activeAlerts={activeAlerts} />;
|
||||
const hosts = state().dockerHosts || [];
|
||||
return <DockerHosts hosts={hosts} activeAlerts={activeAlerts} />;
|
||||
}
|
||||
|
||||
function App() {
|
||||
|
||||
Reference in New Issue
Block a user