From 8fcd094c640e59c62a614012ada3f7fc6a8e64a7 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 2 Feb 2016 10:00:01 -0800 Subject: [PATCH] Fix NPE in the annotation processor for SuppressWarnings Reviewed By: sblackshear Differential Revision: D2886614 fb-gh-sync-id: 97dc110 --- .../facebook/infer/annotprocess/CollectSuppressWarnings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/annotations/com/facebook/infer/annotprocess/CollectSuppressWarnings.java b/infer/annotations/com/facebook/infer/annotprocess/CollectSuppressWarnings.java index 2c2dd9446..6c531526f 100644 --- a/infer/annotations/com/facebook/infer/annotprocess/CollectSuppressWarnings.java +++ b/infer/annotations/com/facebook/infer/annotprocess/CollectSuppressWarnings.java @@ -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);