mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
more error handling for entity encoding
This commit is contained in:
parent
77252f1a99
commit
f0c7460007
1 changed files with 4 additions and 0 deletions
|
|
@ -33,6 +33,10 @@ export function encodeEntityUpdate(props: SendProp[], sendTable: SendTable, stre
|
|||
if (index === -1) {
|
||||
throw new Error(`Unknown definition for property ${prop.definition.fullName} in ${sendTable.name}`);
|
||||
}
|
||||
|
||||
if (index < lastIndex) {
|
||||
throw new Error(`Property index not incremental while encoding ${prop.definition.fullName} in ${sendTable.name} (current: ${index}, last: ${lastIndex})`);
|
||||
}
|
||||
writeFieldIndex(index, stream, lastIndex);
|
||||
lastIndex = index;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue