Skip to content

Commit

Permalink
Check if updated robot model is null
Browse files Browse the repository at this point in the history
  • Loading branch information
oysand committed Jul 1, 2024
1 parent 347193b commit 0122d49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/components/Contexts/RobotContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const RobotProvider: FC<Props> = ({ children }) => {
})
registerEvent(SignalREventLabels.robotUpdated, (username: string, message: string) => {
let updatedRobot: Robot = JSON.parse(message)
if (updatedRobot.model.type == null) {
console.warn('Received robot update with model type null')
return
}
setEnabledRobots((oldRobotList) => {
let oldRobotListCopy = [...oldRobotList]
oldRobotListCopy = upsertRobotList(oldRobotListCopy, updatedRobot)
Expand Down

0 comments on commit 0122d49

Please sign in to comment.