Skip to content

Commit

Permalink
Update mock to cope with handles outside the allowed range
Browse files Browse the repository at this point in the history
  • Loading branch information
cristian-recoseanu committed Aug 2, 2023
1 parent e426caa commit 3ebae8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions code/src/NCModel/Blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,17 @@ export class RootBlock extends NcBlock
}
else
{
socket.send(this.ProcessCommand(msgCommand, socket).ToJson());
isMessageValid = true;
let invalidCommands = msgCommand.commands.filter(x => x.handle <= 0 || x.handle > 65535);
if(invalidCommands.length > 0)
{
isMessageValid = false;
errorMessage = `One of the commands has an invalid handle`;
}
else
{
socket.send(this.ProcessCommand(msgCommand, socket).ToJson());
isMessageValid = true;
}
}
}
break;
Expand Down

0 comments on commit 3ebae8d

Please sign in to comment.