EA-36169 - NPE: JspTypedHandler.handleJspEqual

This commit is contained in:
Dmitry Jemerov
2012-05-17 12:31:53 +02:00
parent f1c6c9db67
commit 8b44b09c79
@@ -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.
@@ -27,6 +27,7 @@ public class JspPsiUtil {
return getJspFile(element) != null;
}
@Nullable
public static JspFile getJspFile(final PsiElement element) {
final PsiFile psiFile = PsiUtilCore.getTemplateLanguageFile(element);
return psiFile instanceof JspFile ? (JspFile)psiFile : null;