diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/EmptyCatchBlockInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/EmptyCatchBlockInspection.java index 3e10f0e01ff3..46cf57756d63 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/EmptyCatchBlockInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/EmptyCatchBlockInspection.java @@ -84,7 +84,7 @@ public class EmptyCatchBlockInspection extends StatementInspection { for (int i = 0; i < catchSections.length; i++) { final PsiCatchSection section = catchSections[i]; final PsiCodeBlock block = section.getCatchBlock(); - if (catchBlockIsEmpty(block)) { + if (block!=null && catchBlockIsEmpty(block)) { final PsiElement catchToken = section.getFirstChild(); registerError(catchToken); }