This code worked in 0.33, but fails in 0.34, because first() returns undefined instead of null when the query has no results:
const setting: Setting | null = Setting.query()
.where('name', name)
.first()
if (setting === null) {
return defaultValue
}
// TypeError: Cannot read property 'value' of undefined
const value: string = setting.value
This code worked in 0.33, but fails in 0.34, because
first()returnsundefinedinstead ofnullwhen the query has no results: