diff --git a/src/electron-main.js b/src/electron-main.js index 9c10faf..30efa4b 100644 --- a/src/electron-main.js +++ b/src/electron-main.js @@ -394,14 +394,16 @@ ipcMain.on('seshat', async function(ev, payload) { case 'closeEventIndex': if (eventIndex !== null) { + let index = eventIndex; + eventIndex = null; + try { - await eventIndex.shutdown(); + await index.shutdown(); } catch (e) { sendError(payload.id, e); return; } } - eventIndex = null; break; case 'deleteEventIndex':