From 99b619497a7bc975b4982267f5c9120ccaffbf59 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 11 May 2016 21:22:06 +0300 Subject: [PATCH] Fix EA-81689 --- .../com/android/tools/klint/checks/ViewTypeDetector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ViewTypeDetector.java b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ViewTypeDetector.java index 0dfd1118703..e9cdca6e703 100644 --- a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ViewTypeDetector.java +++ b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ViewTypeDetector.java @@ -235,6 +235,10 @@ public class ViewTypeDetector extends ResourceXmlDetector implements UastScanner } private UBinaryExpressionWithType findContainingTypeCast(UElement expression) { + if (expression == null) { + return null; + } + if (isTypeCast(expression)) { return (UBinaryExpressionWithType) expression; } else if (expression instanceof UQualifiedExpression) { @@ -244,7 +248,7 @@ public class ViewTypeDetector extends ResourceXmlDetector implements UastScanner } return findContainingTypeCast(parent); } else if (expression instanceof UParenthesizedExpression) { - return findContainingTypeCast(((UParenthesizedExpression) expression).getExpression()); + return findContainingTypeCast(expression.getParent()); } else { return null; }