Fix RemoteTranslate null ref error when translation fails
This commit is contained in:
parent
54721652b3
commit
4619949678
1 changed files with 4 additions and 0 deletions
|
@ -172,6 +172,10 @@ class RemoteTranslate {
|
||||||
let items = [];
|
let items = [];
|
||||||
try {
|
try {
|
||||||
let jsonItems = await actor.sendQuery("translate", { translator: this._translator, id: this._id });
|
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) {
|
if (options.libraryID !== false) {
|
||||||
let itemsLeftToSave = jsonItems.length;
|
let itemsLeftToSave = jsonItems.length;
|
||||||
let attachmentsInProgress = new Set();
|
let attachmentsInProgress = new Set();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue