diff --git a/compiler/src/main/java/com/squareup/anvil/compiler/codegen/dagger/ProvidesMethodFactoryCodeGen.kt b/compiler/src/main/java/com/squareup/anvil/compiler/codegen/dagger/ProvidesMethodFactoryCodeGen.kt index 2df65fd55..87270dd96 100644 --- a/compiler/src/main/java/com/squareup/anvil/compiler/codegen/dagger/ProvidesMethodFactoryCodeGen.kt +++ b/compiler/src/main/java/com/squareup/anvil/compiler/codegen/dagger/ProvidesMethodFactoryCodeGen.kt @@ -549,7 +549,8 @@ internal object ProvidesMethodFactoryCodeGen : AnvilApplicabilityChecker { addStatement( "return module.$callableName$argumentsWithoutModule", ) - !isObject && !returnTypeIsNullable -> + // !isObject && !returnTypeIsNullable + else -> addStatement( "return %T.checkNotNull(module.$callableName" + "$argumentsWithoutModule, %S)",