From 97f01256cd0b5b538095574623f68c0f14125130 Mon Sep 17 00:00:00 2001 From: Steve Messick Date: Thu, 5 Jan 2023 15:55:28 -0800 Subject: [PATCH] Ignore disposed project in FlutterAppManager --- flutter-idea/src/io/flutter/run/FlutterAppManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flutter-idea/src/io/flutter/run/FlutterAppManager.java b/flutter-idea/src/io/flutter/run/FlutterAppManager.java index e39722ed16..888b793cd1 100644 --- a/flutter-idea/src/io/flutter/run/FlutterAppManager.java +++ b/flutter-idea/src/io/flutter/run/FlutterAppManager.java @@ -43,6 +43,7 @@ public static FlutterAppManager getInstance(@NotNull Project project) { private FlutterAppManager(@NotNull Project project) { this.project = project; + // TODO This object shoud have a different disposable parent to enable dynamic plugin loading. Disposer.register(project, this); task = JobScheduler.getScheduler().scheduleWithFixedDelay( @@ -119,6 +120,9 @@ private void updateActiveApp() { @Nullable private RunContentManager getRunContentManager() { + if (project.isDisposed()) { + return null; + } // Creating a RunContentManager causes a blank window to appear, so don't create it here. // See https://github.com/flutter/flutter-intellij/issues/4217 if (ServiceManager.getServiceIfCreated(project, RunContentManager.class) == null) {