Fix RemoteTranslate null ref error when translation fails

This commit is contained in:
Abe Jellinek 2024-07-03 10:18:49 -04:00
parent 54721652b3
commit 4619949678

View file

@ -172,6 +172,10 @@ class RemoteTranslate {
let items = [];
try {
let jsonItems = await actor.sendQuery("translate", { translator: this._translator, id: this._id });
if (jsonItems === null) {
Zotero.debug('RemoteTranslate: translate query returned null');
return null;
}
if (options.libraryID !== false) {
let itemsLeftToSave = jsonItems.length;
let attachmentsInProgress = new Set();