From e28f07dd8486699a29d7bdd0010c50b4ca0041d5 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 18 Dec 2023 06:38:39 +0100 Subject: [PATCH] fix NPE on teardown GitOrigin-RevId: 1fbdd1323db3f4207231cfcc42754549a3ced644 --- .../fixtures/LightJavaCodeInsightFixtureTestCase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java b/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java index 813f23a2437c..f985c93ce8fa 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.testFramework.fixtures; import com.intellij.lang.Language; @@ -133,7 +133,9 @@ public abstract class LightJavaCodeInsightFixtureTestCase extends UsefulTestCase @Override protected void tearDown() throws Exception { try { - myFixture.tearDown(); + if (myFixture != null) { + myFixture.tearDown(); + } } catch (Throwable e) { addSuppressedException(e);