IDEA-246334 Follow-up: do not use computeCastTo for null type

GitOrigin-RevId: 8aca68da4752e752cb92efd02503abbef7fd02da
This commit is contained in:
Tagir Valeev
2020-07-22 04:46:06 +00:00
committed by intellij-monorepo-bot
parent 5c63dd413a
commit bccd2c49a5
@@ -56,7 +56,8 @@ final class DfaBasedFilter {
DfConstantType<?> dfConstantType = (DfConstantType<?>)myDfType;
Object constValue = dfConstantType.getValue();
if (!(constValue instanceof PsiElement)) {
Object value = TypeConversionUtil.computeCastTo(((PsiLiteralValue)element).getValue(), dfConstantType.getPsiType());
Object literalValue = ((PsiLiteralValue)element).getValue();
Object value = constValue == null ? literalValue : TypeConversionUtil.computeCastTo(literalValue, dfConstantType.getPsiType());
return Objects.equals(value, constValue);
}
}