Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen

This commit is contained in:
Nikolay Krasko
2019-04-19 17:48:08 +03:00
parent b83d07ae9a
commit de548d6b8b
@@ -29,8 +29,8 @@ class RemoveUselessIsCheckFixForWhen(element: KtWhenConditionIsPattern) : Kotlin
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
val condition = element ?: return
val whenEntry = condition.parent as KtWhenEntry
val whenExpression = whenEntry.parent as KtWhenExpression
val whenEntry = condition.parent as? KtWhenEntry ?: return
val whenExpression = whenEntry.parent as? KtWhenExpression ?: return
if (condition.isNegated) {
condition.parent.delete()