Skip to content

Commit

Permalink
Merge pull request #756 from Netflix/fix/null-check-sourcepreview
Browse files Browse the repository at this point in the history
Add null check on sourcePreview from InvalidSyntaxException
  • Loading branch information
paulbakker authored Nov 19, 2024
2 parents b48b124 + 7396fa0 commit cb9f828
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CodeGen(private val config: CodeGenConfig) {
parser.parseDocument(parserEnv)
} catch (exception: InvalidSyntaxException) {
// check if the schema is empty
if (exception.sourcePreview.isBlank()) {
if (exception.sourcePreview == null || exception.sourcePreview.isBlank()) {
logger.warn("Schema is empty")
// return an empty document
return Document.newDocument().build()
Expand Down

0 comments on commit cb9f828

Please sign in to comment.