From c034397b45515f57b0a33c10a0fd3f561feed0e1 Mon Sep 17 00:00:00 2001 From: Mario Nebl Date: Fri, 20 Jul 2018 13:41:23 +0200 Subject: [PATCH] fix: guard against missing project --- src/renderer/create-change-notifiers.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderer/create-change-notifiers.ts b/src/renderer/create-change-notifiers.ts index a97fbe964..01c9c162d 100644 --- a/src/renderer/create-change-notifiers.ts +++ b/src/renderer/create-change-notifiers.ts @@ -101,13 +101,16 @@ export function createChangeNotifiers({ app, store }: NotifierContext): void { }, opts); Mobx.autorun(() => { + const project = store.getProject(); + + if (!project) { + return; + } + Sender.send({ id: uuid.v4(), payload: { - userStore: store - .getProject() - .getUserStore() - .toJSON() + userStore: project.getUserStore().toJSON() }, type: Message.MessageType.ChangeUserStore });