Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.10.1] Fixing NPE for @:deprecated support #486

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,20 @@ public void visitFunctionDeclarationWithAttributes(@NotNull HaxeFunctionDeclarat

@Override
public void visitCallExpression(@NotNull HaxeCallExpression o) {
PsiElement child = o.getFirstChild();
final PsiElement child = o.getFirstChild();
if (child instanceof HaxeReferenceExpression) {
HaxeReferenceExpression referenceExpression = (HaxeReferenceExpression) child;
PsiElement reference = referenceExpression.resolve();
final PsiElement reference = referenceExpression.resolve();
final PsiElement lastChild = referenceExpression.getLastChild();

if (reference instanceof HaxeFunctionDeclarationWithAttributes) {
HaxeFunctionDeclarationWithAttributes functionDeclaration = (HaxeFunctionDeclarationWithAttributes)reference;
if (reference instanceof HaxeFunctionDeclarationWithAttributes &&
lastChild != null && lastChild instanceof HaxeReferenceExpression) {

List<HaxeCustomMeta> metas = functionDeclaration.getCustomMetaList();
final HaxeFunctionDeclarationWithAttributes functionDeclaration = (HaxeFunctionDeclarationWithAttributes)reference;
final List<HaxeCustomMeta> metas = functionDeclaration.getCustomMetaList();
for (HaxeCustomMeta meta : metas) {
if (isDeprecatedMeta(meta)) {
handleDeprecatedCallExpression((HaxeReferenceExpression)referenceExpression.getLastChild());
handleDeprecatedCallExpression((HaxeReferenceExpression)lastChild);
}
}
}
Expand Down