Only process diagnostics if corresponding project is alive

Kirill Bulatov created

Part of https://github.com/zed-industries/zed/pull/3128 that is possible
to apply now.

Change summary

crates/project2/src/project2.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/project2/src/project2.rs 🔗

@@ -2986,8 +2986,8 @@ impl Project {
                 let this = this.clone();
                 move |mut params, mut cx| {
                     let adapter = adapter.clone();
-                    adapter.process_diagnostics(&mut params);
                     if let Some(this) = this.upgrade() {
+                        adapter.process_diagnostics(&mut params);
                         this.update(&mut cx, |this, cx| {
                             this.update_diagnostics(
                                 server_id,