mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-02-06 23:24:08 +00:00
Merge pull request #283 from sartography/feature/mitigate-downside-of-unexpected-response-from-server
if we get garbage from backend for active users, do not blow up diagram editing page
This commit is contained in:
commit
4bf6760e3f
@ -40,6 +40,12 @@ export default function ActiveUsers() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []); // it is critical to only run this once.
|
||||
|
||||
// activeUsers is supposed to be an array, but it is based on the response body
|
||||
// from a network call, so who knows what might happen. Be safe.
|
||||
if (!activeUsers.map) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const au = activeUsers.map((activeUser: User) => {
|
||||
return (
|
||||
<div
|
||||
|
Loading…
x
Reference in New Issue
Block a user