From a0e25e5202abe1ff58c5745efcdddebb706753d1 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Sat, 18 Feb 2012 16:10:24 +0100 Subject: [PATCH] EA-33721 (NPE: CastConflictsWithInstanceofInspection$ReplaceFix.doFix) --- .../siyeh/ig/bugs/CastConflictsWithInstanceofInspection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastConflictsWithInstanceofInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastConflictsWithInstanceofInspection.java index 190b60d45a30..9301dcc923ba 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastConflictsWithInstanceofInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastConflictsWithInstanceofInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2011 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2012 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -183,6 +183,9 @@ public class CastConflictsWithInstanceofInspection extends BaseInspection { } final PsiInstanceOfExpression conflictingInstanceof = InstanceOfUtils.getConflictingInstanceof(castTypeElement.getType(), reference, element); + if (conflictingInstanceof == null) { + return; + } final PsiTypeElement instanceofTypeElement = conflictingInstanceof.getCheckType(); if (instanceofTypeElement == null) { return;