Skip to content

Commit

Permalink
returning null if address input is null
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Nov 1, 2022
1 parent 7483e57 commit 9ec4865
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { toChecksumAddress, checkAddressChecksum } from 'ethereum-checksum-address';

export function formatAddress(address: string): string {
if(!address) {
return null;
}
if(address.toLowerCase().startsWith('0x')) {
return toChecksumAddress(address);
}
Expand Down

0 comments on commit 9ec4865

Please sign in to comment.