Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user