From 7750d38f8d752997eb8b468e85364f39cc41d002 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Tue, 6 Aug 2024 19:57:26 +0200 Subject: [PATCH] nullability for InspectionProfileWrapper GitOrigin-RevId: 36861372fd4c124fd245fdf3602476a30e4326da --- .../intellij/codeInspection/ex/InspectionProfileWrapper.java | 4 ++-- .../spellchecker/ui/SpellCheckingEditorCustomization.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileWrapper.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileWrapper.java index 879631c897c8..b0e6ce3fdfd4 100644 --- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileWrapper.java +++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileWrapper.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection.ex; import com.intellij.codeHighlighting.HighlightDisplayLevel; @@ -68,7 +68,7 @@ public class InspectionProfileWrapper { } } - public boolean isToolEnabled(final HighlightDisplayKey key, PsiElement element) { + public boolean isToolEnabled(@Nullable HighlightDisplayKey key, PsiElement element) { return myProfile.isToolEnabled(key, element); } diff --git a/spellchecker/src/com/intellij/spellchecker/ui/SpellCheckingEditorCustomization.java b/spellchecker/src/com/intellij/spellchecker/ui/SpellCheckingEditorCustomization.java index ab696e7e0ec9..46648979dec6 100644 --- a/spellchecker/src/com/intellij/spellchecker/ui/SpellCheckingEditorCustomization.java +++ b/spellchecker/src/com/intellij/spellchecker/ui/SpellCheckingEditorCustomization.java @@ -141,7 +141,7 @@ public class SpellCheckingEditorCustomization extends SimpleEditorCustomization @Override public boolean isToolEnabled(HighlightDisplayKey key, PsiElement element) { - return SPELL_CHECK_TOOLS.containsKey(key.toString()) ? myUseSpellCheck : super.isToolEnabled(key, element); + return (key != null && SPELL_CHECK_TOOLS.containsKey(key.toString()) ? myUseSpellCheck : super.isToolEnabled(key, element)); } } }