File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
querydsl-tooling/querydsl-ksp-codegen/src/main/kotlin/com/querydsl/ksp/codegen Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ class QueryDslProcessor(
2828 override fun finish () {
2929 val models = typeProcessor.process()
3030 models.forEach { model ->
31+ if (model.originatingFile == null ) {
32+ // skip models without originating file. This happens when the model is from a compiled dependency,
33+ // so we don't have access to the source file. It is expected the Q class is packaged alongside the
34+ // compiled dependency.
35+ return @forEach
36+ }
37+
3138 val typeSpec = QueryModelRenderer .render(model)
3239 FileSpec .builder(model.className)
3340 .indent(settings.indent)
@@ -36,7 +43,7 @@ class QueryDslProcessor(
3643 .writeTo(
3744 codeGenerator = codeGenerator,
3845 aggregating = false ,
39- originatingKSFiles = listOfNotNull (model.originatingFile)
46+ originatingKSFiles = listOf (model.originatingFile)
4047 )
4148 }
4249 }
You can’t perform that action at this time.
0 commit comments