Fixed EA-70733

This commit is contained in:
Valentin Kipyatkov
2015-07-28 13:36:33 +03:00
parent 4355b3ed00
commit 8f940b07fb
@@ -50,7 +50,7 @@ public class IterateExpressionIntention : JetSelfTargetingIntention<JetExpressio
val bindingContext = expression.analyze(BodyResolveMode.PARTIAL)
val type = bindingContext.getType(expression) ?: return null
val moduleDescriptor = expression.getResolutionFacade().findModuleDescriptor(expression)
val scope = bindingContext[BindingContext.RESOLUTION_SCOPE, expression]!!
val scope = bindingContext[BindingContext.RESOLUTION_SCOPE, expression] ?: return null
val elementType = IterableTypesDetector(expression.getProject(), moduleDescriptor, scope).elementType(type)?.type ?: return null
return Data(type, elementType)
}