Ensure the progress bar is hidden if session initialisation fails

This commit is contained in:
Adomas Venčkauskas 2018-04-24 12:52:11 +03:00
parent e31d706ee4
commit 8b36f33513

View File

@ -388,6 +388,7 @@ Zotero.Integration = new function() {
* @return {Zotero.Integration.Session} Promise
*/
this.getSession = async function (app, doc, agent) {
try {
var progressBar = new Zotero.Integration.Progress(4, Zotero.isMac && agent != 'http');
progressBar.show();
@ -469,6 +470,10 @@ Zotero.Integration = new function() {
throw e;
}
}
} catch (e) {
progressBar.hide(true);
throw e;
}
session.agent = agent;
session._doc = doc;
if (session.progressBar) {