diff --git a/ts/util/createIPCEvents.ts b/ts/util/createIPCEvents.ts index 879bec8e21cc..8ff79997520b 100644 --- a/ts/util/createIPCEvents.ts +++ b/ts/util/createIPCEvents.ts @@ -227,9 +227,17 @@ export function createIPCEvents( getDeviceName: () => window.textsecure.storage.user.getDeviceName(), getPhoneNumber: () => { - const e164 = window.textsecure.storage.user.getNumber(); - const parsedNumber = instance.parse(e164); - return instance.format(parsedNumber, PhoneNumberFormat.INTERNATIONAL); + try { + const e164 = window.textsecure.storage.user.getNumber(); + const parsedNumber = instance.parse(e164); + return instance.format(parsedNumber, PhoneNumberFormat.INTERNATIONAL); + } catch (error) { + log.warn( + 'IPC.getPhoneNumber: failed to parse our E164', + Errors.toLogFormat(error) + ); + return ''; + } }, getZoomFactor: () => {