Skip to content

Commit d997833

Browse files
committed
refactor(core): add null checks on handle resolution
1 parent d49c527 commit d997833

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/core/src/ui/components/DestinationAddressInput/DestinationAddressInput.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const DestinationAddressInput = ({
8282
[HandleVerificationState.INVALID]: <ExclamationCircleOutlined className={styles.invalid} />,
8383
[HandleVerificationState.VERIFYING]: undefined
8484
};
85-
const handleIcon = handleIcons[handle] || undefined;
85+
const handleIcon = (handle && handleIcons[handle]) || undefined;
8686

8787
const shouldClearButtonBeDisabled =
8888
(!valid && !empty) ||
@@ -105,7 +105,10 @@ export const DestinationAddressInput = ({
105105

106106
const children = useMemo(() => {
107107
if (handle === HandleVerificationState.CHANGED_OWNERSHIP) {
108-
return value.name && getInputLabel(`$${value.handleResolution.handle}`, value.handleResolution.cardanoAddress);
108+
return (
109+
value.name &&
110+
getInputLabel(`$${value.handleResolution?.handle}`, value.handleResolution?.cardanoAddress.toString() ?? '')
111+
);
109112
}
110113
return value.name && getInputLabel(value.name, value.address);
111114
}, [handle, value]);

packages/core/src/ui/components/EditAddressForm/EditAddressForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const EditAddressForm = ({
8787
invalid={!isAddressFieldValid}
8888
label={translations.address}
8989
dataTestId="address-form-address-input"
90-
customIcon={!isAddressFieldValidating && isAddressHandle && renderSuffix()}
90+
customIcon={(!isAddressFieldValidating && isAddressHandle && renderSuffix()) || undefined}
9191
loading={isAddressFieldValidating}
9292
/>
9393
</Form.Item>

0 commit comments

Comments
 (0)