From 4ab47254fe942b89c478ddba646e369b2e68d89b Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Fri, 22 Mar 2024 18:26:30 +0100 Subject: [PATCH] EA-1129470: don't wrap AlreadyDisposed in PCE if under !cancellable section GitOrigin-RevId: bd71f3212b87df14a42ca06989ec88b190c6d20e --- .../src/com/intellij/serviceContainer/containerUtil.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/service-container/src/com/intellij/serviceContainer/containerUtil.kt b/platform/service-container/src/com/intellij/serviceContainer/containerUtil.kt index 4fc1b935eb28..9ec42b002e6f 100644 --- a/platform/service-container/src/com/intellij/serviceContainer/containerUtil.kt +++ b/platform/service-container/src/com/intellij/serviceContainer/containerUtil.kt @@ -1,5 +1,6 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. @file:ApiStatus.Internal + package com.intellij.serviceContainer import com.intellij.ide.plugins.PluginManagerCore @@ -46,7 +47,10 @@ fun throwAlreadyDisposedError(serviceDescription: String, componentManager: Comp */ @ApiStatus.Internal fun wrapAlreadyDisposedError(error: AlreadyDisposedException): RuntimeException { - if (!isUnderIndicatorOrJob()) { + if (Cancellation.isInNonCancelableSection()) { + return error + } + else if (!isUnderIndicatorOrJob()) { return error } else {