Fix ClassCastException in ReactModuleSpecProcessor

Reviewed By: AaaChiuuu

Differential Revision: D4752195

fbshipit-source-id: 7c01f9be4d82dbc605f1e6d3b217f0c83f177165
This commit is contained in:
Jonathan Lawlor 2017-03-22 11:10:45 -07:00 committed by Facebook Github Bot
parent ef3db66bb1
commit 379b60d5e8
1 changed files with 4 additions and 0 deletions

View File

@ -79,6 +79,10 @@ public class ReactModuleSpecProcessor extends AbstractProcessor {
Set<? extends Element> reactModuleListElements = roundEnv.getElementsAnnotatedWith(
ReactModuleList.class);
for (Element reactModuleListElement : reactModuleListElements) {
if (!(reactModuleListElement instanceof TypeElement)) {
continue;
}
TypeElement typeElement = (TypeElement) reactModuleListElement;
ReactModuleList reactModuleList = typeElement.getAnnotation(ReactModuleList.class);
if (reactModuleList == null) {