Skip to content

Commit cb9f828

Browse files
authored
Merge pull request #756 from Netflix/fix/null-check-sourcepreview
Add null check on sourcePreview from InvalidSyntaxException
2 parents b48b124 + 7396fa0 commit cb9f828

File tree

1 file changed

+1
-1
lines changed
  • graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen

1 file changed

+1
-1
lines changed

graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/CodeGen.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class CodeGen(private val config: CodeGenConfig) {
139139
parser.parseDocument(parserEnv)
140140
} catch (exception: InvalidSyntaxException) {
141141
// check if the schema is empty
142-
if (exception.sourcePreview.isBlank()) {
142+
if (exception.sourcePreview == null || exception.sourcePreview.isBlank()) {
143143
logger.warn("Schema is empty")
144144
// return an empty document
145145
return Document.newDocument().build()

0 commit comments

Comments
 (0)