From 0d4d0086dba38b5c88d8fe168f87912d30f8c8e3 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 22 Jun 2015 13:09:27 +0300 Subject: [PATCH] EA-69262 - NPE: DebuggerTreeNodeExpression.substituteThis --- .../debugger/ui/impl/watch/DebuggerTreeNodeExpression.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java index 3695d0c462b0..df04d5a53eff 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -34,6 +34,7 @@ import com.intellij.util.IncorrectOperationException; import com.sun.jdi.ObjectReference; import com.sun.jdi.ReferenceType; import com.sun.jdi.Value; +import org.jetbrains.annotations.Nullable; /** * User: lex @@ -147,8 +148,10 @@ public class DebuggerTreeNodeExpression { return false; } - public static PsiExpression substituteThis(PsiExpression expressionWithThis, PsiExpression howToEvaluateThis, Value howToEvaluateThisValue) + @Nullable + public static PsiExpression substituteThis(@Nullable PsiExpression expressionWithThis, PsiExpression howToEvaluateThis, Value howToEvaluateThisValue) throws EvaluateException { + if (expressionWithThis == null) return null; PsiExpression result = (PsiExpression)expressionWithThis.copy(); PsiClass thisClass = PsiTreeUtil.getContextOfType(result, PsiClass.class, true);