fix: prevent "cannot read properties of undefined (reading 'map')" crash (#532)
This commit is contained in:
committed by
GitHub
Unverified
parent
925fbab86d
commit
11e28a2cfa
@@ -22,11 +22,11 @@ interface AgentsState {
|
||||
|
||||
function applySnapshot(snapshot: AgentsSnapshot | undefined) {
|
||||
return snapshot ? {
|
||||
agents: snapshot.agents,
|
||||
defaultAgentId: snapshot.defaultAgentId,
|
||||
configuredChannelTypes: snapshot.configuredChannelTypes,
|
||||
channelOwners: snapshot.channelOwners,
|
||||
channelAccountOwners: snapshot.channelAccountOwners,
|
||||
agents: snapshot.agents ?? [],
|
||||
defaultAgentId: snapshot.defaultAgentId ?? 'main',
|
||||
configuredChannelTypes: snapshot.configuredChannelTypes ?? [],
|
||||
channelOwners: snapshot.channelOwners ?? {},
|
||||
channelAccountOwners: snapshot.channelAccountOwners ?? {},
|
||||
} : {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user