editcheck: Remove try/catch around transaction squashing

According to T333710 we haven't seen an error in the last year.

Change-Id: I7ee3447674cdda8a4350b6cf10d5d907c2162e2e
This commit is contained in:
Ed Sanders 2024-10-01 14:20:52 +01:00
parent 4cd67004de
commit cf8a08f76c

View file

@ -59,16 +59,7 @@ mw.editcheck.getModifiedRanges = function ( documentModel, coveredNodesOnly ) {
if ( !documentModel.completeHistory.getLength() ) { if ( !documentModel.completeHistory.getLength() ) {
return []; return [];
} }
let operations; const operations = documentModel.completeHistory.squash().transactions[ 0 ].operations;
try {
operations = documentModel.completeHistory.squash().transactions[ 0 ].operations;
} catch ( err ) {
// TransactionSquasher can sometimes throw errors; until T333710 is
// fixed just count this as not needing a reference.
mw.errorLogger.logError( err, 'error.visualeditor' );
return [];
}
const ranges = []; const ranges = [];
let offset = 0; let offset = 0;
const endOffset = documentModel.getDocumentRange().end; const endOffset = documentModel.getDocumentRange().end;