Skip to content

Commit

Permalink
Guard against NPE with broken SQL files
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Sep 1, 2023
1 parent d45eeeb commit 230f4b9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object readSqlFileDirectories {
def queryTypeFor(decomposedSql: DecomposedSql, c: Connection): SqlCommandType = {
val pc = c.unwrap(classOf[PgConnection])
val q = pc.createQuery(decomposedSql.sqlWithNulls, true, false)
q.query.getSqlCommand.getType
Option(q.query.getSqlCommand).map(_.getType).getOrElse(SqlCommandType.BLANK)
}

def findSqlFilesUnder(scriptsPath: Path): List[Path] = {
Expand Down

0 comments on commit 230f4b9

Please sign in to comment.