Fix NPE in the annotation processor for SuppressWarnings

Reviewed By: sblackshear

Differential Revision: D2886614

fb-gh-sync-id: 97dc110
master
Jeremy Dubreil 9 years ago committed by facebook-github-bot-5
parent 75f4947cb1
commit 8fcd094c64

@ -84,7 +84,7 @@ public class CollectSuppressWarnings extends AbstractProcessor {
for (TypeElement te : annotations) {
for (Element e : env.getElementsAnnotatedWith(te)) {
SuppressWarnings annot = e.getAnnotation(SuppressWarnings.class);
if (shouldProcess(annot)) {
if (annot != null && shouldProcess(annot)) {
if (e instanceof TypeElement) { // class
String className = elements.getBinaryName((TypeElement) e).toString();
mSuppressMap.put(className, Collections.EMPTY_SET);

Loading…
Cancel
Save