Skip to content

Commit

Permalink
Bug fix for when the default is set to null
Browse files Browse the repository at this point in the history
  • Loading branch information
ed0906 committed Jan 24, 2022
1 parent 5135961 commit e83160f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.gradle
/build/
build
*/build

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class DefaultTemplatedCellMappingExtension(private val defaults: Defaults) : Cel
val value = cell.value
return if (value != null && value is String && value.startsWith('[') && value.endsWith(']')) {
cell.mapValue {
overrides[value] ?: defaults.forColumn(table, cell.key)?.value ?: throw DbUnitException(
"Expected an Override for $value but there wasn't one configured. Overrides available were: ${overrides.entries.joinToString { (k, v) -> "$k=$v" }}"
)
overrides[value] ?: run {
defaults.forColumn(table, cell.key) ?: throw DbUnitException(
"Expected an Override for $value but there wasn't one configured. Overrides available were: ${overrides.entries.joinToString { (k, v) -> "$k=$v" }}"
)
}.value
}
} else cell
}
Expand Down

0 comments on commit e83160f

Please sign in to comment.