fix(ui): do not allow comparison between undefined original types

This commit is contained in:
psychedelicious 2024-05-17 20:33:44 +10:00
parent 2cbf7d9221
commit 6a2c53f6c5

View File

@ -9,13 +9,13 @@ export const areTypesEqual = (sourceType: FieldType, targetType: FieldType) => {
if (isEqual(_sourceType, _targetType)) { if (isEqual(_sourceType, _targetType)) {
return true; return true;
} }
if (isEqual(_sourceType, _targetTypeOriginal)) { if (_targetTypeOriginal && isEqual(_sourceType, _targetTypeOriginal)) {
return true; return true;
} }
if (isEqual(_sourceTypeOriginal, _targetType)) { if (_sourceTypeOriginal && isEqual(_sourceTypeOriginal, _targetType)) {
return true; return true;
} }
if (isEqual(_sourceTypeOriginal, _targetTypeOriginal)) { if (_sourceTypeOriginal && _targetTypeOriginal && isEqual(_sourceTypeOriginal, _targetTypeOriginal)) {
return true; return true;
} }
return false; return false;