Fixed NPEs

This commit is contained in:
Valentin Kipyatkov
2014-11-28 13:30:27 +03:00
parent 9283daccb6
commit db6bf787fc
@@ -286,7 +286,7 @@ class PartialBodyResolveFilter(
}
override fun visitIfExpression(expression: JetIfExpression) {
expression.getCondition().accept(this)
expression.getCondition()?.accept(this)
val thenBranch = expression.getThen()
val elseBranch = expression.getElse()
@@ -308,7 +308,7 @@ class PartialBodyResolveFilter(
}
override fun visitWhileExpression(loop: JetWhileExpression) {
val condition = loop.getCondition()
val condition = loop.getCondition() ?: return
if (condition.isTrueConstant()) {
insideLoopLevel++
loop.getBody()?.accept(this)
@@ -316,7 +316,7 @@ class PartialBodyResolveFilter(
}
else {
// do not make sense to search exits inside while-loop as not necessary enter it at all
condition?.accept(this)
condition.accept(this)
}
}