From: Ian Jackson Date: Tue, 30 Mar 2021 23:28:04 +0000 (+0100) Subject: script: Do not assert that the piece exists X-Git-Tag: otter-0.5.0~340 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7368f077005b5272265ae63b310c5099601f9d01;p=otter.git script: Do not assert that the piece exists For Insert it does not. We don't notice this, because we cast all the actual handler functions. Acked-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 9c844cae..0d588557 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1061,7 +1061,7 @@ function handle_piece_update(j: TransmitUpdateEntry_Piece) { var piece = j.piece; var m = j.op as { [k: string]: Object }; var k = Object.keys(m)[0]; - let p = pieces[piece]!; + let p = pieces[piece]; pieceops[k](piece,p, m[k]); };