EA-33721 (NPE: CastConflictsWithInstanceofInspection$ReplaceFix.doFix)

This commit is contained in:
Bas Leijdekkers
2012-02-18 16:10:24 +01:00
parent 7c747797b9
commit a0e25e5202
@@ -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;