Merge pull request #13570 from Budibase/fix/isBetterSample-null-reference
Fix some null reference on builder
This commit is contained in:
commit
2afb13db7a
|
@ -365,13 +365,11 @@
|
||||||
|
|
||||||
function getAllowedTypes() {
|
function getAllowedTypes() {
|
||||||
if (originalName) {
|
if (originalName) {
|
||||||
const possibleTypes = (
|
const possibleTypes = SWITCHABLE_TYPES[field.type] || [
|
||||||
SWITCHABLE_TYPES[field.type] || [editableColumn.type]
|
editableColumn.type,
|
||||||
).map(t => t.toLowerCase())
|
]
|
||||||
return Object.entries(FIELDS)
|
return Object.entries(FIELDS)
|
||||||
.filter(([fieldType]) =>
|
.filter(([_, field]) => possibleTypes.includes(field.type))
|
||||||
possibleTypes.includes(fieldType.toLowerCase())
|
|
||||||
)
|
|
||||||
.map(([_, fieldDefinition]) => fieldDefinition)
|
.map(([_, fieldDefinition]) => fieldDefinition)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,10 @@ const isBetterSample = (newValue, oldValue) => {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldValue != null && newValue == null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Don't change type
|
// Don't change type
|
||||||
const oldType = typeof oldValue
|
const oldType = typeof oldValue
|
||||||
const newType = typeof newValue
|
const newType = typeof newValue
|
||||||
|
|
Loading…
Reference in New Issue