Fix EA-81689

This commit is contained in:
Yan Zhulanow
2016-05-11 21:22:06 +03:00
parent af9f6d96bb
commit 99b619497a
@@ -235,6 +235,10 @@ public class ViewTypeDetector extends ResourceXmlDetector implements UastScanner
} }
private UBinaryExpressionWithType findContainingTypeCast(UElement expression) { private UBinaryExpressionWithType findContainingTypeCast(UElement expression) {
if (expression == null) {
return null;
}
if (isTypeCast(expression)) { if (isTypeCast(expression)) {
return (UBinaryExpressionWithType) expression; return (UBinaryExpressionWithType) expression;
} else if (expression instanceof UQualifiedExpression) { } else if (expression instanceof UQualifiedExpression) {
@@ -244,7 +248,7 @@ public class ViewTypeDetector extends ResourceXmlDetector implements UastScanner
} }
return findContainingTypeCast(parent); return findContainingTypeCast(parent);
} else if (expression instanceof UParenthesizedExpression) { } else if (expression instanceof UParenthesizedExpression) {
return findContainingTypeCast(((UParenthesizedExpression) expression).getExpression()); return findContainingTypeCast(expression.getParent());
} else { } else {
return null; return null;
} }