From b47635850129a5e468a049ecd29b79796e8e424c Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 23 Feb 2012 14:47:40 +0100 Subject: [PATCH] EA-33945 - PIEAE: LeafPsiElement.invalid --- .../actions/AbstractSuppressByNoInspectionCommentFix.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/actions/AbstractSuppressByNoInspectionCommentFix.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/actions/AbstractSuppressByNoInspectionCommentFix.java index c13e696286b8..5aa07844a57e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/actions/AbstractSuppressByNoInspectionCommentFix.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/actions/AbstractSuppressByNoInspectionCommentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,11 +96,11 @@ public abstract class AbstractSuppressByNoInspectionCommentFix extends SuppressI @Override public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement context) { - return context.getManager().isInProject(context) && getContainer(context) != null; + return context.isValid() && context.getManager().isInProject(context) && getContainer(context) != null; } @Override - public void invoke(final Project project, @Nullable Editor editor, final PsiElement element) throws IncorrectOperationException { + public void invoke(@NotNull final Project project, @Nullable Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException { PsiElement container = getContainer(element); if (container == null) return;