Skip to content

Commit

Permalink
fix: address in AddressItem can be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
juanky201271 committed Mar 19, 2024
1 parent dd9e9cc commit 447259c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/Components/AddressItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const AddressItem: React.FunctionComponent<AddressItemProps> = ({
const [contact, setContact] = useState<string>('');

useEffect(() => {
const numLinesAdd = address.length < 40 ? 2 : address.length / 30;
const numLinesAdd = address ? (address.length < 40 ? 2 : address.length / 30) : 0;
const cont: string = addressBook
.filter((ab: AddressBookFileClass) => ab.address === address)
.map((ab: AddressBookFileClass) => ab.label)
Expand Down

0 comments on commit 447259c

Please sign in to comment.