nullability for InspectionProfileWrapper

GitOrigin-RevId: 36861372fd4c124fd245fdf3602476a30e4326da
This commit is contained in:
Max Medvedev
2024-08-06 19:57:26 +02:00
committed by intellij-monorepo-bot
parent 4d6e4a513b
commit 7750d38f8d
2 changed files with 3 additions and 3 deletions

View File

@@ -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; package com.intellij.codeInspection.ex;
import com.intellij.codeHighlighting.HighlightDisplayLevel; 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); return myProfile.isToolEnabled(key, element);
} }

View File

@@ -141,7 +141,7 @@ public class SpellCheckingEditorCustomization extends SimpleEditorCustomization
@Override @Override
public boolean isToolEnabled(HighlightDisplayKey key, PsiElement element) { 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));
} }
} }
} }